This script controls the piece on the board, it alters graphics according to promotions/reverts and registers mouse down and mouse up events for dragging purposes
More...
Inherits MonoBehaviour.
|
enum | Type {
WhitePawn = 1,
WhiteRook = 2,
WhiteKnight = 3,
WhiteBishop = 4,
WhiteQueen = 5,
WhiteKing = 6,
BlackPawn = -1,
BlackRook = -2,
BlackKnight = -3,
BlackBishop = -4,
BlackQueen = -5,
BlackKing = -6
} |
| All possible chess types. More...
|
|
This script controls the piece on the board, it alters graphics according to promotions/reverts and registers mouse down and mouse up events for dragging purposes
◆ Type
All possible chess types.
◆ moveToSquare()
Move to a new square.
- Parameters
-
newSquare | the new square to move to. |
◆ SetCallbacks()
Set mouse callbacks to allow this instance to be dragged and dropped.
- Parameters
-
onDown | Callback for mouse down |
onUp | Callback for mouse up |
◆ SetType() [1/2]
void cgChessPieceScript.SetType |
( |
Type |
toType | ) |
|
Set the type of this piece, changes its sprite accordingly. Useful when reverting moves, or when pawns are promoted.
- Parameters
-
toType | The type to change to. |
◆ SetType() [2/2]
void cgChessPieceScript.SetType |
( |
int |
toType | ) |
|
Set the type of this piece, changes its sprite accordingly. Useful when reverting moves, or when pawns are promoted.
- Parameters
-
toType | The type to change to. |
◆ StartAtSquare()
Start at provided square.
- Parameters
-
startSquare | the starting square. |
◆ dead
bool cgChessPieceScript.dead = false |
◆ displayAs3D
bool cgChessPieceScript.displayAs3D |
Should we display as 3d?(true) or 2d(false).
◆ square
The current square being occupied by this instance.
◆ threeDPieceHolder
GameObject cgChessPieceScript.threeDPieceHolder |
If displaying as 3d, we will use the models insde this Holder.
◆ twoDPieceHolder
GameObject cgChessPieceScript.twoDPieceHolder |
If displaying as 2d, we will use the sprites insde this Holder.
◆ type
Type cgChessPieceScript.type = Type.WhitePawn |
◆ white
bool cgChessPieceScript.white |
|
get |
The documentation for this class was generated from the following file:
- code/scripts/cgChessPieceScript.cs