/// <summary> /// Пожертвования. /// </summary> public void Donation() { Console.WriteLine("How much money do you want to donate?"); decimal userInputMoney = decimal.Parse(Console.ReadLine()); Console.WriteLine($"Where do you want to donate your money?"); foreach (var item in DonationPlaces) { Console.WriteLine(item); } var userInput = int.Parse(Console.ReadLine()); decimal sum = _money - userInputMoney; switch (userInput) { case 1: ShowMoney?.Invoke($"Thank you for donation in medicine, now in your account {sum} y.e."); break; case 2: ShowMoney?.Invoke($"Thank you for donation in education, now in your account {sum} y.e."); break; default: throw new ArgumentException(); } }
void Start() { moneyDisplay = GameObject.FindWithTag("moneydisplay"); showMoneyScript = moneyDisplay.GetComponent <ShowMoney>(); restrainScript = GetComponent <Restraints>(); createTowerScript = GameObject.FindWithTag("itemspanel").GetComponent <CreateTower>(); }
/// <summary> /// Пополнение счёта. /// </summary> public void Refill() { Console.WriteLine("How much money do you want to put into your account?"); decimal userInputMoney = decimal.Parse(Console.ReadLine()); decimal sum = _money + userInputMoney; ShowMoney?.Invoke($"Now in your account {sum} y.e."); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); ShowMoney money = ShowEuros; money(12.1932); money = ShowDollars; money(12.1932); }
void Start() { numberAttackers = timeOffsets.Count; lastTime = Time.time; nextAttacker = roundAttackers[attackerPosition]; nextTimeOffset = timeOffsets[attackerPosition]; moneyDisplay = GameObject.FindWithTag("moneydisplay"); showMoneyScript = moneyDisplay.GetComponent <ShowMoney>(); startRoundButton = GameObject.FindWithTag("startbutton"); startRoundsScript = startRoundButton.GetComponent <StartRounds>(); }
/// <summary> /// Снятие со счёта. /// </summary> public void CashWithdrawall() { Console.WriteLine($"On your account {_money} y.e.\nHow much money do you want to withdraw from the account?"); decimal userInputMoney = decimal.Parse(Console.ReadLine()); if (_money < userInputMoney) { throw new ArgumentException(); } decimal sum = _money - userInputMoney; ShowMoney?.Invoke($"Now in your account {sum} y.e."); }
/// <summary> /// Проверка баланса. /// </summary> public void AccountBalance() => ShowMoney?.Invoke($"Account balance: {_money}");
void Start() { moneyDisplay = GameObject.FindWithTag("moneydisplay"); showMoneyScript = moneyDisplay.GetComponent <ShowMoney>(); }
// Use this for initialization private void Awake() { instance = this; moneystr = transform.GetComponent <Text>(); }
void Start() { transform.localScale = new Vector3(0, 0, 0); moneyDisplay = GameObject.FindWithTag("moneydisplay"); showMoneyScript = moneyDisplay.GetComponent <ShowMoney>(); }