public void ResetMoney() { money = 0; if (onMoneyChangedCallback != null) { onMoneyChangedCallback.Invoke(); } }
public void AddMoney(int _ammount, int _currencyType = 0) { savegame.currency[_currencyType] += _ammount; OnMoneyChanged?.Invoke(savegame.currency[_currencyType], _currencyType); }
public void Attached() { //Call event OnHPChanged?.Invoke(_hp); OnMoneyChanged?.Invoke(_money); OnHonorsChanged?.Invoke(); }
public void ChangeMoney(int sumToAdd) { if (sumToAdd > 0 || Money >= sumToAdd) { Money += sumToAdd; OnMoneyChanged?.Invoke(Money, sumToAdd); } }
public bool CostMoney(int m) { if (_money - m < 0) { return(false); } _money -= m; OnMoneyChanged?.Invoke(-m); return(true); }
public Player SetMoney(int m) { if (m > Config.PLAYER_MAX_MONEY) { m = Config.PLAYER_MAX_MONEY; } _money = m; OnMoneyChanged?.Invoke(_money); return(this); }
public Player AddMoney(int m) { _money += m; if (_money > Config.PLAYER_MAX_MONEY) { _money = Config.PLAYER_MAX_MONEY; } OnMoneyChanged?.Invoke(m); return(this); }
/// <summary> /// Reduces income by a specified amount /// </summary> /// <param name="_spentFunds">Income to spend</param> public bool SpendFunds(int _spentFunds) { if (_spentFunds <= funds) { funds -= _spentFunds; UIManager.GetInstance().SetFundsText(funds); OnMoneyChanged?.Invoke(funds); return(true); } else { return(false); } }
/// <summary> /// Adds income based on success and need /// </summary> public void AddMonthlyIncome() { UpdateRefugeeValues(); // for readability and in case we ever want to display these int successIncome = Mathf.RoundToInt((weight1 * Mathf.Log(refugeeHealth * refugeeVolume + refugeesResettled)) * multiplier); int needIncome = Mathf.RoundToInt((weight2 * Mathf.Log(refugeeVolume) + 1) * multiplier); int monthlyIncome = successIncome + needIncome; funds += monthlyIncome; Debug.Log("Monthly Income: " + successIncome + "(s) + " + needIncome + "(n) = " + monthlyIncome); UIManager.GetInstance().SetFundsText(funds); OnMoneyChanged?.Invoke(funds); }
public void ReachedTopOfRope() { // square the rope is at xPos = 7; yPos = 1; zPos = 0; targetPos = GetGridPosition(); // so you stay put usingRope = false; lastAnchorX = 7; lastAnchorY = 1; lastAnchorZ = 0; UpdateDepth(); OnRopeEnd?.Invoke(); // should maybe do a cutscene here // also I probably fall in a hole // DumpOre() money += CalculateMoney(); OnMoneyChanged?.Invoke(money); backPack = 0; OnPackFillChanged?.Invoke(backPack, backPackCap); }
public void Pay(int price) { money -= price; OnMoneyChanged?.Invoke(money); }
private void RPC_ChangeMoney(int increment) { _currentMoney += increment; OnMoneyChangedCallBack.Invoke(); }
public void DecrementMoney(int amount) { _curGameStatistics.Money -= amount; OnMoneyChanged?.Invoke(_curGameStatistics.Money); }
public void GetMoney(int amount) { currentMoney += amount; OnMoneyChangedCallBack.Invoke(); }
public void Sell(TowerData towerData) { money += towerData.Price; OnMoneyChanged?.Invoke(money); }
public void SpendMoney(int amountToSpend) { money -= amountToSpend; OnMoneyChanged?.Invoke(money); }
private void HandleEnemyKilled(EnemyData enemyData) { money += enemyData.MoneyReward; OnMoneyChanged?.Invoke(money); }
/// <summary> /// Adds a specified amount of income from an event /// </summary> /// <param name="_eventFunds">Income to add</param> public void AddEventIncome(int _eventFunds) { funds += _eventFunds; UIManager.GetInstance().SetFundsText(funds); OnMoneyChanged?.Invoke(funds); }
private void InitializeUI() { OnRoundChanged?.Invoke(_currentGameStatistics.Rounds.ToString()); OnMoneyChanged?.Invoke(_currentGameStatistics.Money.ToString()); OnLivesChanged?.Invoke(_currentGameStatistics.Lives.ToString()); }
private void InitializeUI() { OnRoundChanged?.Invoke(_curGameStatistics.Rounds); OnMoneyChanged?.Invoke(_curGameStatistics.Money); OnLivesChanged?.Invoke(_curGameStatistics.Lives); }
private static void NotifyMoneyChanged(int balance) { OnMoneyChanged?.Invoke(_instance.playerData.Money.value); }
private void ChangeMoney(int amount) { Money += amount; OnMoneyChanged?.Invoke(Money); }