bank account refactor

This commit is contained in:
hydrant
2020-03-15 21:33:04 +01:00
parent 75e26b8e8a
commit 92c054c90c
30 changed files with 2088 additions and 300 deletions

View File

@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Finance
public static (int, float, float) GetEconomyClass(Player client, int wage)
{
int bankAccount = client.GetUser().GetBankAccount().Balance;
int bankAccount = client.GetUser().BankAccount.Balance;
float financialHelp = -(float)Math.Pow(1.0005, -bankAccount) * -1000;
float financialInterest = 1 - (float)Math.Pow(1.00006, -wage) * 1;
if (financialInterest >= 0.7)
@@ -182,7 +182,7 @@ namespace ReallifeGamemode.Server.Finance
{
using (var dbContext = new DatabaseContext())
{
client.GetUser().GetBankAccount(dbContext).Balance += paycheck.Amount;
client.GetUser(dbContext).BankAccount.Balance += paycheck.Amount;
client.GetUser(dbContext).Wage = 0;
dbContext.SaveChanges();
}