Exemplo n.º 1
0
        public static void Move(piece piece, int roll)
        {
            int index = piece.Index + roll;

            //Removes the piece on the board.
            board[index].removePiece();
            //Checks if the board is empty
            if (board[index].Count > 0 || board[index].BoardPiece.Color == piece.Color)
            {
                board[index].AddPiece(piece);
            }
            else
            {
                if (board[index].Special == "globe")
                {
                    piece.Home = true;
                }
                else if (board[index].Count >= 2)
                {
                    piece.Home = true;
                }
                else
                {
                    board[index].BoardPiece.Home = true;
                }
            }
        }
Exemplo n.º 2
0
 public team(string color, bool human, int id)
 {
     Id     = id;
     Color  = color;
     Human  = human;
     Points = 0;
     for (int i = 0; i < 4; i++)
     {
         Pieces[i] = new piece(13 * id + 2, i, Color);
     }
 }
Exemplo n.º 3
0
 public void AddPiece(piece number1)
 {
     BoardPiece = number1;
     Count++;
 }