示例#1
0
        //-- Creating a goal piece (with or without a house on it-- put zero for no house/person)
        //   at a particular place on the edge of the board.
        public int createGoalPiece(int houseNumber, int personNumber, Coordinates c)
        {
            int p = Pieces.createGreenGrassPiece();

            p = Pieces.setHouseNumber(p, houseNumber);
            p = Pieces.setPersonNumber(p, personNumber);
            p = this.setGoalDirections(p, c);
            return(p);
        }
示例#2
0
 public static int combinePieces(int p1, int p2)
 {
     // Combines a piece that is a person or house, with a regular piece.  Order is unimportant.
     // Returns the failure piece if neither piece is a plain person or house.
     if (Pieces.isTile(p1))
     {
         int t = p1; p1 = p2; p2 = t;
     }
     if (Pieces.isPerson(p1) && Pieces.isTile(p2))
     {
         return(Pieces.setPersonNumber(p2, Pieces.personNumber(p1)));
     }
     if (Pieces.isHouse(p1) && Pieces.isTile(p2))
     {
         return(Pieces.setHouseNumber(p2, Pieces.houseNumber(p1)));
     }
     return(Pieces.createFailurePiece());
 }