Example #1
0
        /// <summary>
        /// Initialisiert einen Spieler mit dem angegebenen Typ und einer Armee.
        /// </summary>
        public Player(PlayerType playerType, Armee armee)
        {
            PlayerType = playerType;
            Armee      = armee;

            ThrowDice();
        }
Example #2
0
        /// <summary>
        /// Initialisiert das Skelett einer Player-Klasse.
        /// </summary>
        public Player(PlayerType playerType)
        {
            PlayerType = playerType;
            Armee      = new Armee();
            Withdrawn  = new Armee();
            DiceList   = new List <int>(3);

            ThrowDice();
        }
Example #3
0
        public bool Missing(Armee armee, string player)
        {
            var somethingMissing = false;

            if (armee.Stacks.Count == 0)
            {
                outputTextbox.Text += $"{player}, du hast keine Truppen ausgewählt! \r\n";
                somethingMissing    = true;
            }

            foreach (Stack stack in armee.Stacks)
            {
                if (stack.Count != 0)
                {
                    continue;
                }

                outputTextbox.Text += $"{player}, gib deine Truppenzahl der {stack.StackUnit.Name} an!";
                somethingMissing    = true;
            }

            return(somethingMissing);
        }
Example #4
0
 public bool Equals(Armee that)
 {
     return(this.Stacks.SequenceEqual(that.Stacks));
 }
Example #5
0
 private void swap(Armee armee)
 {
     armee.Stacks.Reverse();
 }