Class Piece

  • All Implemented Interfaces:
    Serializable

    @Entity
    public class Piece
    extends Object
    implements Serializable
    Represents a piece of a specified type at a specified location. Used in board description.
     "boardObjectsArrays":{
         "Cvu0lwRnl":{
         "id":"Cvu0lwRnl",
         "value":
         [{"color":"yellow","shape":"square","id":"1","x":1,"y":1},
         {"color":"black","shape":"square","id":"6","x":6,"y":1},
         {"color":"red","shape":"square","id":"31","x":1,"y":6},
         {"color":"blue","shape":"square","id":"36","x":6,"y":6}],
         "name":"Four squares in corners"}
         }
    }
    
    See Also:
    Serialized Form
    • Constructor Detail

      • Piece

        public Piece()
      • Piece

        public Piece​(String _image,
                     int _x,
                     int _y)
    • Method Detail

      • setBoard

        public void setBoard​(Board _board)
      • getId

        public long getId()
      • setId

        public void setId​(long _id)
      • getImage

        public String getImage()
      • setImage

        public void setImage​(String _image)
      • getProperty

        public String getProperty​(String name)
        Empty in SC objects; contains properties in IPB objects
      • getColor

        public String getColor()
        This method is used just for Jersey/REST, to simplify JSON output structure, making it similar to that used in Game Engine 1.0
      • setColor

        public void setColor​(Piece.Color x)
        This is how it used by our JsonToJava, when reading board files
      • getShape

        public String getShape()
        For JSON
      • setShape

        public void setShape​(Piece.Shape x)
        This is how it used by our JsonToJava
      • xgetShape

        public Piece.Shape xgetShape()
        For use in our application
      • objectType

        public String objectType()
      • getX

        public int getX()
      • setX

        public void setX​(int _x)
      • getY

        public int getY()
      • setY

        public void setY​(int _y)
      • getDropped

        public Integer getDropped()
      • setDropped

        public void setDropped​(Integer _dropped)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getBuckets

        public int[] getBuckets()
      • setBuckets

        public void setBuckets​(int[] _buckets)