Class Board


  • @Entity
    public class Board
    extends Object
    • Constructor Detail

      • Board

        public Board()
        Creates an empty board
      • Board

        public Board​(RandomRG random,
                     edu.wisc.game.sql.PositionMask positionMask,
                     int randomCnt,
                     boolean crowded)
        The simple constructor, creates a random board with a given number of pieces, using the 4 legacy colors.
      • Board

        public Board​(RandomRG random,
                     edu.wisc.game.sql.PositionMask positionMask,
                     int randomCnt,
                     int nShapes,
                     int nColors,
                     Piece.Shape[] allShapes,
                     Piece.Color[] allColors,
                     boolean crowded)
        The main constructor for a random initial board in GS 2.*.
        Parameters:
        random - The random number generator to use
        positionMask - This may restrict the positions to which game pieces may be placed
        randomCnt - required number of pieces.
        nShapes - required number of shapes. If 0 is passed, there is no restriction (independent decision is made for each piece)
        nColors - required number of colors. If 0 is passed, there is no restriction (independent decision is made for each piece)
        allShapes - the set from which shapes are drawn
        allColors - the set from which colors are drawn
      • Board

        public Board​(RandomRG random,
                     int randomCnt,
                     ImageObject.Generator imageGenerator)
        The main constructor for a random image-and-property-based initial board in GS 3.*.
        Parameters:
        randomCnt - required number of pieces.
        allImages - the set from which images are drawn
      • Board

        public Board​(Vector<Piece> pieces,
                     Vector<Piece> removedPieces,
                     BitSet[] moveableTo)
        Creates a Board object to be sent out (as JSON) to the player's client, based on the current state of the episode.
        Parameters:
        pieces - The pieces still on the board. (A dense array). with nulls)
        removedPieces - If not null, these pieces will also be included into the generated Board object, with the flag dropped=true. This is what the GUI client wants.
        moveableTo - Specifies to which buckets each piece can be moved to. Coordinayed with "pieces"