Package edu.wisc.game.sql
Class Piece
java.lang.Object
edu.wisc.game.sql.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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPiece.Colorstatic classPiece.PseudoEnumA flexible replacement for an Enumstatic classPiece.Shape -
Constructor Summary
Constructors Constructor Description Piece()Piece(Piece.Shape _shape, Piece.Color _color, int _x, int _y)Piece(String _image, int _x, int _y) -
Method Summary
Modifier and Type Method Description booleanequals(Object o)int[]getBuckets()StringgetColor()This method is used just for Jersey/REST, to simplify JSON output structure, making it similar to that used in Game Engine 1.0IntegergetDropped()longgetId()StringgetImage()ImageObjectgetImageObject()StringgetProperty(String name)StringgetShape()For JSONintgetX()intgetY()inthashCode()StringobjectType()Board.Pospos()voidsetBoard(Board _board)voidsetBuckets(int[] _buckets)voidsetColor(Piece.Color x)This is how it used by our JsonToJava, when reading board filesvoidsetDropped(Integer _dropped)voidsetId(long _id)voidsetImage(String _image)voidsetShape(Piece.Shape x)This is how it used by our JsonToJavavoidsetX(int _x)voidsetY(int _y)StringtoString()Piece.ColorxgetColor()Piece.ShapexgetShape()For use in our application
-
Constructor Details
-
Method Details
-
setBoard
-
getId
public long getId() -
setId
public void setId(long _id) -
getImage
-
setImage
-
getProperty
- Returns:
- null for a SC object; the value of the specified property for an IPB object
-
getImageObject
-
xgetColor
-
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
This is how it used by our JsonToJava, when reading board files -
getShape
For JSON -
setShape
This is how it used by our JsonToJava -
xgetShape
For use in our application -
objectType
-
getX
public int getX() -
setX
public void setX(int _x) -
getY
public int getY() -
setY
public void setY(int _y) -
getDropped
-
setDropped
-
equals
-
hashCode
public int hashCode() -
pos
-
getBuckets
public int[] getBuckets() -
setBuckets
public void setBuckets(int[] _buckets) -
toString
-