示例#1
0
        public void Play()
        {
            board.drawBoard(Current_Phase.ToString(), Current_Player.Color.ToString());      // Changed this so that board.Cows is not public anymore
            int input;

            switch (Current_Phase)
            {
            case Phase.Placing:
                input = External.PlaceInput();
                DoPlacePhase(input);
                break;

            case Phase.Killing:
                input = External.KillPosInput();
                DoKillPhase(input);
                break;

            case Phase.Moving:
                input = External.MoveFromInput();
                DoMovePhase(input);
                break;

            case Phase.Winning:
                External.Winner(Current_Player.Color);
                break;
            }
        }
示例#2
0
        private void DoMovePhase(int input)
        {
            if (Current_Player.Select(input, board, referee))
            {
                int inputTo = External.MoveToInput();                                   // We might need to move this for testing but lets see how it goes

                if (board.numPlayerCowsOnBoard(Current_Player.Color) == 3)              //  If flying
                {
                    Flying(input, inputTo);
                }
                else if (Current_Player.Move(input, inputTo, board, referee, Current_Phase))
                {
                    if (board.areNewMills(Current_Player.Color))
                    {
                        Current_Phase = Phase.Killing;
                    }
                    else
                    {
                        SwitchPlayer();
                    }
                }
            }
        }
示例#3
0
 public void drawBoard(string State, string PlayerName)
 {
     External.DrawBoard(Cows, State, PlayerName);
 }