示例#1
0
        /// <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();
            }
        }
示例#2
0
文件: OnCreate.cs 项目: eddddddy/MTD
 void Start()
 {
     moneyDisplay      = GameObject.FindWithTag("moneydisplay");
     showMoneyScript   = moneyDisplay.GetComponent <ShowMoney>();
     restrainScript    = GetComponent <Restraints>();
     createTowerScript = GameObject.FindWithTag("itemspanel").GetComponent <CreateTower>();
 }
示例#3
0
        /// <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.");
        }
示例#4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            ShowMoney money = ShowEuros;

            money(12.1932);
            money = ShowDollars;
            money(12.1932);
        }
示例#5
0
文件: Rounds.cs 项目: eddddddy/MTD
    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>();
    }
示例#6
0
        /// <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.");
        }
示例#7
0
 /// <summary>
 /// Проверка баланса.
 /// </summary>
 public void AccountBalance() => ShowMoney?.Invoke($"Account balance: {_money}");
示例#8
0
 void Start()
 {
     moneyDisplay    = GameObject.FindWithTag("moneydisplay");
     showMoneyScript = moneyDisplay.GetComponent <ShowMoney>();
 }
示例#9
0
 // Use this for initialization
 private void Awake()
 {
     instance = this;
     moneystr = transform.GetComponent <Text>();
 }
示例#10
0
 void Start()
 {
     transform.localScale = new Vector3(0, 0, 0);
     moneyDisplay         = GameObject.FindWithTag("moneydisplay");
     showMoneyScript      = moneyDisplay.GetComponent <ShowMoney>();
 }