示例#1
0
        public void UsersActivityInQuantityOfDiceMenu()
        {
            bool closeWindow = false;

            DiceAmount = 0;
            NumOfDice  = new TextLine(10, 25, 100, DiceAmount.ToString());

            while (closeWindow != true)
            {
                _QuantityOfDiceWindow.Render();

                if (NumOfDice != null)
                {
                    NumOfDice.Render();
                }

                ConsoleKeyInfo pressedChar = Console.ReadKey(true);

                switch (pressedChar.Key)
                {
                case ConsoleKey.Escape:
                    closeWindow     = true;
                    closeAllProgram = true;
                    break;

                case ConsoleKey.Subtract:

                    if (DiceAmount > 0)
                    {
                        DiceAmount--;
                    }

                    NumOfDice = new TextLine(10, 25, 100, DiceAmount.ToString());
                    break;

                case ConsoleKey.Add:

                    DiceAmount++;
                    NumOfDice = new TextLine(10, 25, 100, DiceAmount.ToString());
                    break;

                case ConsoleKey.Enter:
                    closeWindow = true;
                    break;
                }
            }
        }
示例#2
0
 public override string ToString()
 {
     return(DiceAmount.ToString() + "d" + DiceValue.ToString());
 }