public void Talk(int seconds) { if (seconds > 0) { if (isActiveted) { while (seconds != 0) { if (Account > 0) { TalkingSeconds += 1; Account -= 1; Console.WriteLine($"Your current account is : {Account}"); Thread.Sleep(1000); } else { //Notify?.Invoke("No money on your account!"); Notify2?.Invoke(this, "No money on your account!"); break; } } } else { Console.WriteLine("Activate your account!"); } } else { throw new ArgumentException(); } }
public void AddLevel(int level) { Console.ForegroundColor = ConsoleColor.Green; Operation operation = (x, y) => x + y; operation(CareerLevel, level); Notify2?.Invoke($"Уровень в карьерной лестнице увеличен {level}"); Console.ResetColor(); }
public void AddSalary(int money) { Operation operation = (x, y) => x + y; operation(Salary, money); Console.ForegroundColor = ConsoleColor.Green; Notify2?.Invoke($"Зарплата повышена на {money}$"); Console.ResetColor(); }
public void Add(int money) { if (money > 0) { Account += money; //Notify?.Invoke($"You add {money} on you account!"); Notify2?.Invoke(this, $"You add {money} on you account!"); } else { throw new ArgumentException(); } }
public void Count() { for (int i = 1; i <= 100; i++) { count++; if (count == 77) { Notify?.Invoke(this, new Handler1("Пора действовать, ведь уже 77")); Notify2?.Invoke(this, new Handler2("Уже 77, давно пора было начать!")); } } }