Added automatic update of business when bank account changes

This commit is contained in:
hydrant
2018-11-22 20:17:04 +01:00
parent 74dc1db8af
commit a72d65eb18
2 changed files with 12 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using reallife_gamemode.Server.Business;
using reallife_gamemode.Server.Managers;
using reallife_gamemode.Server.Util;
using System;
using System.Collections.Generic;
@@ -10,10 +11,20 @@ namespace reallife_gamemode.Server.Entities
{
public class BusinessBankAccount : IBankAccount
{
[NotMapped]
private int _balance;
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public int Balance { get; set; }
public int Balance {
get => _balance;
set
{
_balance = value;
BusinessManager.GetBusiness(BusinessId).Update();
}
}
public int BusinessId { get; set; }
}

View File

@@ -13,7 +13,6 @@ using reallife_gamemode.Server.Util;
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Managers
{
public class BankManager