Store the logical position of chess, based plugin of my board-series plugins/behaviors.
Categories > Board > rex_boardIntroductionLinksDependenceUsageConfigure boardSetup layoutSizeLogical positionCreate chessAdd tilesRemove/Destroy chessClean boardRetrieve cellsOn the boardMaximum or minimum of logic X, logic Y of all chessMove chessSwap chessKicked chessLogical overlappingEmpty cellGet empty cellSOLPick all chessPick chess according to logical positionPick chess above tilesPick neighbor chessPhysical or logical positionLogical position and chess UIDZ-indexGet physical positionPhysical position to logical positionWrapString symbol chessInfinity boardSave & load
Puts one of board-layout plugin into project. Each board object should have a board-layout object.
Action:Setup layout to assign board-layout object manuallyProperty Width and Height , or Action:Set board width, Action:Set board height
Expression:BoardWidth, Expression:BoardHeightEach chess or tile has a logical position (x,y,z). Each logical position only could have one instance (chess or tile).
x , y : number
board.width-1board.height-1z : number or string
Action:Create tileAction:Create chessAction:Create chess above tile, orAction:Fill tiles, to fill all tiles on boardThe created instance will be put at the right position directly.
X at (0,0), Y at (0,0) in layout plugin (rex_board_squareTx, or rex_board_hexTx), if the created chess does not appear.Action:Add tileAction:Add chess, or Action:Add chess by UIDThese actions would not change the physical position of instance.
Remove chess automatically, after instance destroyed
Remove chess without destroying instance
Action:Remove chessAction:Remove chess by UIDRemove chess and destroy instance
Action:Destroy chessAction:Reset board
Condition:For each cell
Expression:CurLX, Expression:CurLY ) Condition:For each LZ at LXY
Expression:CurLZCondition:On the board, returns true if the chess instance is on the board.Expression:MaxLX, Expression:MaxLY)Expression:MinLX, Expression:MinLY)Move logical position of chess
Action:Move chessAction:Move chess by UIDAction:Move chess to xyzAction:Move chess to xyz by UIDAction:Move chess to zSwap logical position of two chess
Action:Swap chess by UIDThe chess will be kicked after chess created/added/moved, since each logical position only could have one chess.
Condition:On chess kicked will be triggered when chess kicking, to pick kicked chess.
Mostly, the kicking should not happened, therefore this condition might be used for debugging during development stage.
To avoid kicking, user could assign z-index of each chess by its uid .
For example,
xxxxxxxxxx"#"+chess.uidSo that all z-index of chess will be different.
Condition:Is overlapping, returns true if chess are overlapping with the same logical (x,y) position. The z index of these chess will be different. Condition:On chess kicked, if the z-index of these chess are the same, see previous section.Condition:Is emptyCondition:Is occupiedIf a logical position is not in the board, these two conditions will return false.
Sample capx , Sample capx (on tiles)
Condition:Has any empty cell, Condition:Has any empty cell on tiles
Expression:EmptyLX , Expression:EmptyLY)Condition:Pick an empty cell, Condition:Pick an empty cell on tiles
Expression:EmptyLX , Expression:EmptyLY)There has another way to pick an empty cell, see the section of Examples in rex_chess.
Pick all chess
Condition:Pick all chess, Action:Pick all chessPick specific type of chess
Condition:Pick chess, Action:Pick chessPick a chess at specific LXYZ
Condition:Pick chess at Logic X,Y,Z, Action:Pick chess at Logic X,Y,ZPick all chess at specific LX, LY, or LZ
Condition:Pick chess at LX, Action:Pick chess at LXCondition:Pick chess at LY, Action:Pick chess at LYCondition:Pick chess at LZ, Action:Pick chess at LZPick chess at specific LXY
Condition:Pick chess at Logic X,Y, Action:Pick chess at Logic X,YCondition:Pick chess inside a square, Action:Pick chess inside a squarePick chess above based tile.
Condition:Pick chess above tile, Action:Pick chess above tile
Condition:Pick chess above tile UID, Action:Pick chess above tile UID
Parameter UID
number, for single chess
JSON string, for multiple chess. For example,
xxxxxxxxxx"[300,301,302,303]"from instance group plugin's Expression:GroupToString
Condition:Pick neighbor chess, Action:Pick neighbor chess
Parameter Direction
Expression:DIR2UID, get the UID of neighbor chess by origin chess and direction
Condition:Are neighbors (UID), returns true if two chess are neighbor.
UID --> LX, LY, LZ
Expression:UID2LX Expression:UID2LY Expression:UID2LZLXYZ --> UID
Expression:LXYZ2UIDUID, LZ --> UID
Expression:LZ2UID, get the chess at a z-index above a chess. i.e. the same logical (x,y) but different z-index.LXY/UID --> amount of chess at LXY
Expression:LXY2ZCn, Expression:UID2ZCntLXY/LXYZ/UID --> PX, PY
Expression:LXY2PXExpression:LXY2PY Expression:LXYZ2PXExpression:LXYZ2PYExpression:UID2PXExpression:UID2PYPXY --> Align PX, Align PY
Expression:PXY2NearestPXExpression:PXY2NearestPYCondition:Point is in board, returns true if the physical position is inside board.
PXY --> LX, LY
Expression:PXY2LXExpression:PXY2LY Set property Wrap to Yes, or Action:Set wrap mode
Sample capx A chess is an instance, or replaced by a unique string symbol to reduce the amount of instances.
Call Action:Add chess by UID to add a string symbol into this board.
Although string symbol is not a real instance, it still could use these expressions
Expression:UID2LX , Expression:UID2LY , Expression:UID2LZ )Expression:LXYZ2UID, or Expression:LZ2UIDExpression:UID2PX, Expression:UID2PY )Expression:PXY2UIDSample capx
Set property Infinity to Yes
Wrap mode is ignoredAction:Fill tiles.It supports official saving & loading feature.