static void Main(string[] args) { double bag = 0; Menu result = new Menu(); GetCoin click = new GetCoin(); ConsoleKeyInfo cki; do { Console.Clear(); result.DisplayMenu(); Console.WriteLine("Coin:" + bag); Console.WriteLine("Income:" + GetCoin.income); bag = GetCoin.pocket; cki = Console.ReadKey(false); switch (cki.KeyChar.ToString()) { case "1": bag = bag + click.Click(); GetCoin.pocket = bag; break; case "2": //Console.Clear(); result.Store(); break; case "3": break; } } while (cki.Key != ConsoleKey.Escape); }
public void Store() { Menu result2 = new Menu(); GetCoin monster = new GetCoin(); ConsoleKeyInfo cki; do { Console.Clear(); result2.StoreMenu(); Console.WriteLine("Coin:" + GetCoin.pocket); Console.WriteLine("Income:" + GetCoin.income); cki = Console.ReadKey(false); switch (cki.KeyChar.ToString()) { case "1": if (GetCoin.pocket > GetCoin.mod1) { monster.Monster1(); GetCoin.pocket = GetCoin.pocket - GetCoin.mod1; } else { } break; case "2": if (GetCoin.pocket > GetCoin.mod2) { monster.Monster2(); GetCoin.pocket = GetCoin.pocket - GetCoin.mod2; } else { } break; case "3": if (GetCoin.pocket > GetCoin.mod3) { monster.Monster3(); GetCoin.pocket = GetCoin.pocket - GetCoin.mod3; } else { } break; case "4": if (GetCoin.pocket > GetCoin.mod4) { monster.Monster4(); GetCoin.pocket = GetCoin.pocket - GetCoin.mod4; } else { } break; case "5": if (GetCoin.pocket > GetCoin.mod5) { monster.Monster5(); GetCoin.pocket = GetCoin.pocket - GetCoin.mod5; } else { } break; default: break; } }while (cki.Key != ConsoleKey.Escape); }