private void AddMoney() { Console.WriteLine("Choose the wallet:\n(1) USD Wallet\n(2) EUR Wallet\n(3) UAH Wallet\n(4) RUB Wallet\n(5) CNY Wallet"); var userOperation = Console.ReadLine(); if (userOperation == "1" & USD == true) { walletUSD.AddMoney(); } else if (userOperation == "2" & EUR == true) { walletEUR.AddMoney(); } else if (userOperation == "3" & UAH == true) { walletUAH.AddMoney(); } else if (userOperation == "4" & RUB == true) { walletRUB.AddMoney(); } else if (userOperation == "5" & CNY == true) { walletCNY.AddMoney(); } else { Console.WriteLine("There is no such wallet or you haven't enabled it yet."); } }
private void GivePlayerRandomValue(Collider other) { Wallet wallet = other.GetComponent <Wallet>(); int randomValue = Random.Range(minValue, maxValue + 1); wallet.AddMoney(randomValue); }
public void WalletShouldAddBalance() { var wallet = new Wallet(100); wallet.AddMoney(103); Assert.Equal(wallet.Balance, 100 + 103); }
public void SellProfits() { // enable all cards when invested wallet.AddMoney(invested); unaffectedInvest = 0; invested = 0f; loss = 0f; profit = 0f; investedIdeas.Clear(); }
public void SellItem(Item i) { //If at a shop, we have the item, and the shop can afford/will be able to resell it if (currentShop && inventory.HasNumberOfItem(i, 1) && currentShop.TryBuyFromPlayer(i)) { inventory.RemoveFromInventory(i, 1); wallet.AddMoney(i.GetPrice()); } }
public bool Pay(int cost, Wallet to) { if (cost > money) { return(false); } money -= cost; to.AddMoney(cost); return(true); }
/// <summary> /// Shop is selling to the player. /// </summary> /// <param name="i"></param> public void SellToPlayer(Item i) { if (!shopper || !HasNumberOfItem(i, 1)) { return; } if (shopper.TryBuyItem(i, 1)) { RemoveFromInventory(i, 1); wallet.AddMoney(i.GetPrice()); } }
void EarnIncome() { TimeToIncome += Time.deltaTime; if (TimeToIncome >= IncomeDelay) { TimeToIncome = 0f; Debug.Log("Earn income"); int totalProfit = 0; foreach (var income in Incomes) { totalProfit += income; } _wallet.AddMoney(totalProfit); } }
public void GetAmount(int amountToGet) { _wallet.AddMoney(amountToGet); }