예제 #1
0
        public void Start()
        {
            // Setup the console window size to be 100 x 30 characters, and showing the start menu
            Console.SetWindowSize(Constants.WINDOW_WIDTH, Constants.WINDOW_HEIGHT);
            CLIUI.StartMenu(ref m_PlayerName, ref m_Rounds);

            // Initializing the Player object, with the new operator.
            // And gives the player a special attack, "Nut Crusher"
            m_PlayerBoxer = new PlayerBoxer(m_PlayerName);
            m_PlayerBoxer.Attacks.Add(new Attack("Nut crusher", 6, 20));

            // Initializing the NPC object.
            string name = CLIUI.ChooseOpponentMenu(m_BoxerNames);

            m_ComputerBoxer = new NPCBoxer(name);
        }
예제 #2
0
        public void Update()
        {
            Console.Clear();

            int currentBout = 0;

            while (m_IsRunning)
            {
                while (currentBout < Constants.MAX_BOUTS)
                {
                    UpdateBout(ref currentBout);
                }
                Boxer winner = GetWinner();
                int   input  = CLIUI.WinnerMenu(winner);
                switch (input)
                {
                case 1: Start(); currentBout = 0; break;

                case 2: m_IsRunning = false; break;
                }
            }
        }
예제 #3
0
        private Attack ChooseAttack()
        {
            int i = CLIUI.ChooseAttackMenu(Attacks);

            return(Attacks[i]);
        }