Interface IBlockSquad
Instance that provide map block data from unit position
Methods
FindBlock(int, int, int, int, Direction4, BlockType, out int, out int, int)
Get block position from given unit position to given direction
Declaration
bool FindBlock(int id, int unitX, int unitY, int unitZ, Direction4 direction, BlockType type, out int resultX, out int resultY, int maxDistance = 128)
Parameters
Type | Name | Description |
---|---|---|
int | id | Block ID to find |
int | unitX | Start unit position X |
int | unitY | Start unit position Y |
int | unitZ | Position Z |
Direction4 | direction | Searching direction |
BlockType | type | Type of the target block |
int | resultX | Position X in unit space |
int | resultY | Position Y in unit space |
int | maxDistance | Limitation of searching distance (Default 128) |
Returns
Type | Description |
---|---|
bool | True if the block founded |
GetAllBlocksAt(int, int, int)
Get all blocks ID at given unit position
Declaration
(int level, int bg, int entity, int element) GetAllBlocksAt(int unitX, int unitY, int z)
Parameters
Type | Name | Description |
---|---|---|
int | unitX | X position in unit space |
int | unitY | Y position in unit space |
int | z | Z position |
GetBlockAt(int, int, int, BlockType)
Get block ID at given unit position
Declaration
int GetBlockAt(int unitX, int unitY, int z, BlockType type)
Parameters
Type | Name | Description |
---|---|---|
int | unitX | X position in unit space |
int | unitY | Y position in unit space |
int | z | Z position |
BlockType | type | Type of the block |
SetBlockAt(int, int, int, BlockType, int)
Set block ID at given unit position
Declaration
void SetBlockAt(int unitX, int unitY, int z, BlockType type, int newID)
Parameters
Type | Name | Description |
---|---|---|
int | unitX | X position in unit space |
int | unitY | Y position in unit space |
int | z | Z position |
BlockType | type | Type of the block |
int | newID | Block ID |
WorldExists(Int3)
True if world data exists at given position
Declaration
bool WorldExists(Int3 worldPos)
Parameters
Type | Name | Description |
---|---|---|
Int3 | worldPos | Position in world space (1 world space = 256 * 128 global space) |