Categories > Board > rex_board

Introduction

Store the logical position of chess, based plugin of my board-series plugins/behaviors.

Links


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

Dependence

Usage

Configure board

Sample capx

Setup layout

Puts one of board-layout plugin into project. Each board object should have a board-layout object.

BoardSquareTxHexTx

Size

Logical position

Each chess or tile has a logical position (x,y,z). Each logical position only could have one instance (chess or tile).

Create chess

The created instance will be put at the right position directly.

Add tiles

These actions would not change the physical position of instance.

Remove/Destroy chess

Clean board

Action:Reset board

Retrieve cells

Sample capx

Condition:For each cell Expression:CurLX, Expression:CurLYCondition:For each LZ at LXY Expression:CurLZ

On the board

Maximum or minimum of logic X, logic Y of all chess


Move chess

Move logical position of chess

Swap chess

Swap logical position of two chess

Kicked chess

The 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.uid

So that all z-index of chess will be different.

Logical overlapping


Empty cell

If a logical position is not in the board, these two conditions will return false.

Get empty cell

Condition:Has any empty cell, orCondition:Has any empty cell on tilesExpression:EmptyLX, Expression:EmptyLYCondition:Pick an empty cell, orCondition:Pick an empty cell on tiles

Sample capx , Sample capx (on tiles)

There has another way to pick an empty cell, see the section of Examples in rex_chess.


SOL

Pick all chess

Pick chess according to logical position

Pick chess above tiles

Pick neighbor chess

Sample capx


Physical or logical position

(Expression:UID2PX, Expression:UID2PY)(Expression:UID2LX, Expression:UID2LY, Expression:UID2LZ)Expression:LXYZ2UID(Expression:LXYZ2PX, Expression:LXYZ2PY)(Expression:PXY2LX, Expression:PXY2LY)UIDPXYLXYZ

Logical position and chess UID

Z-index

Get physical position

Physical position to logical position


Wrap

Sample capx


String symbol chess

Sample capx A chess is an instance, or replaced by a unique string symbol to reduce the amount of instances.


Infinity board

Sample capx Set property Infinity to Yes


Save & load

It supports official saving & loading feature.