Example #1
0
        /// <summary>
        /// Plays through the current state of the match, in one iteration.
        /// </summary>
        protected override bool PlayLogic()
        {
            switch (CurrentPhase)
            {
            case Phase.Placement:
                WaitForTimeout();
                CurrentPhase = Phase.Turn;
                break;

            case Phase.Turn:
                waitList.Add(CurrentPlayer);
                CurrentPlayer.BeginTurn();
                WaitForTimeout();
                CurrentPlayer.EndTurn();
                if (TurnOrder.Count == 1)
                {
                    CurrentPlayer.Win();
                    CurrentPhase = Phase.End;
                }
                break;

            case Phase.End:
                return(false);
            }
            return(true);
        }
Example #2
0
 public void NextTurn()
 {
     turn    = (turn + 1) % players.Length;
     playing = true;
     CurrentPlayer.BeginTurn(this);
 }