Esempio n. 1
0
        static void Main(string[] args)
        {
            ConsoleExtras.ColorLine("What would you like to do?\n1. Test Monsters\n2. Start Simulation");
            bool @continue;

            switch (ConsoleExtras.GetIntInput())
            {
            case 1:
            {
                ConsoleExtras.ColorLine("How many tests per monster? (1-100)");
                int amount = Math.Min(Math.Max(1, ConsoleExtras.GetIntInput()), 100);
                Console.Clear();
                new BalanceTester(amount).TestMonsters();
                Console.WriteLine();
                @continue = true;
                break;
            }

            case 2:
            {
                var engine = new Engine();
                engine.Start();

                Console.Clear();

                while (engine.Continue)
                {
                    engine.Update();
                }

                ConsoleExtras.ColorLine("Want to play again?");
                @continue = ConsoleExtras.GetBoolInput();
                Console.Clear();
                break;
            }

            default:
                ConsoleExtras.ColorLine("INVALID OPTION", ConsoleColor.Red);
                @continue = true;
                break;
            }

            if (@continue)
            {
                Main(null);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IMonster player = InstantiatePlayer();
            IMonster enemy  = InstantiateEnemy(player.Race);

            Console.Clear();

            for (int i = 0; player.IsAlive && enemy.IsAlive; i++)
            {
                ConsoleExtras.ColorLine("Select Option:\n\r1. Fight\n\r2. Check Stats");

                switch (ConsoleExtras.GetIntInput())
                {
                case 1:
                    Attack(i, player, enemy);
                    break;

                case 2:
                    ConsoleExtras.ColorLine($"\nYour monster's stats:\t{player}", ConsoleColor.Cyan);
                    ConsoleExtras.ColorLine($"Enemy's stats:\t{enemy}\n", ConsoleColor.Red);
                    break;

                default:
                    ConsoleExtras.ColorLine("Invalid Selection", ConsoleColor.Red);
                    break;
                }

                Console.WriteLine();
            }

            if (player.IsAlive)
            {
                ConsoleExtras.ColorLine("YOU WIN!", ConsoleColor.Cyan);
            }
            else
            {
                ConsoleExtras.ColorLine("YOU LOSE", ConsoleColor.Red);
            }

            ConsoleExtras.ColorLine("Want to play again?");
            if (ConsoleExtras.GetBoolInput())
            {
                Console.Clear();
                Main(null);
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            bool @continue;

            var engine = new Engine();

            engine.Start();

            Console.Clear();

            while (engine.Continue)
            {
                engine.Update();
            }

            ConsoleExtras.ColorLine("Want to play again?");
            @continue = ConsoleExtras.GetBoolInput();
            Console.Clear();

            if (@continue)
            {
                Main(null);
            }
        }