ClassicCityBuilderKit 1.8.8
|
basic map functionality like map size and buildability
Public Member Functions | |
bool | IsInside (Vector2Int point) |
checks if a point is inside the map size | |
bool | IsWalkable (Vector2Int point) |
check if a point can be walked on and may be used in pathfinding | |
bool | IsBuildable (Vector2Int point, int mask, object tag=null) |
checks if a point is ok to build on or if the map somehow blocks building there | |
bool | CheckGround (Vector2Int point, Object[] options) |
checks the ground for certain features for example in tilemap base maps this would be a tile | |
Vector3 | ClampPosition (Vector3 position) |
clamps a position to be inside the maps size if, for example, a position 5,-10 is passed for a map that starts at 0,0 the position will be clamped to 5,0 | |
Vector2Int | ClampPoint (Vector2Int point) |
clamps a point to be inside the maps size | |
Vector3 | GetVariance () |
get position variance for walkers and such, can be used so walkers on the same point dont overlap | |
Properties | |
bool | IsXY [get] |
whether the map grid is in xy, usually in 2d games 3d games often use Y as the height axis and have their grid in XZ | |
bool | IsHex [get] |
whether we're on a hexagonal map which may need some special handling | |
Vector2Int | Size [get] |
map size in cell count | |
Vector3 | CellOffset [get] |
delta position from one cell to the next | |
Vector3 | WorldCenter [get] |
world position at the center of the map | |
bool CityBuilderCore.IMap.CheckGround | ( | Vector2Int | point, |
Object[] | options ) |
checks the ground for certain features
for example in tilemap base maps this would be a tile
point | the point on the map to check |
options | a set of features that would be acceptable |
Implemented in CityBuilderCore.DefaultMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
Vector2Int CityBuilderCore.IMap.ClampPoint | ( | Vector2Int | point | ) |
clamps a point to be inside the maps size
point | a point that may or may not be inside the map |
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
Vector3 CityBuilderCore.IMap.ClampPosition | ( | Vector3 | position | ) |
clamps a position to be inside the maps size
if, for example, a position 5,-10 is passed for a map that starts at 0,0 the position will be clamped to 5,0
position | the position to check |
Implemented in CityBuilderCore.HexagonMap, CityBuilderCore.IsometricMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
Vector3 CityBuilderCore.IMap.GetVariance | ( | ) |
get position variance for walkers and such, can be used so walkers on the same point dont overlap
Implemented in CityBuilderCore.IsometricMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
bool CityBuilderCore.IMap.IsBuildable | ( | Vector2Int | point, |
int | mask, | ||
object | tag = null ) |
checks if a point is ok to build on or if the map somehow blocks building there
point | the point on the map to check |
mask | the structure levels to check, 0 for all |
Implemented in CityBuilderCore.DefaultMap, CityBuilderCore.MapBase, CityBuilderCore.TerrainMap, and CityBuilderCore.Tests.DebugMap.
bool CityBuilderCore.IMap.IsInside | ( | Vector2Int | point | ) |
checks if a point is inside the map size
point | the point to check |
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
bool CityBuilderCore.IMap.IsWalkable | ( | Vector2Int | point | ) |
check if a point can be walked on and may be used in pathfinding
point | the point to check |
Implemented in CityBuilderCore.DefaultMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
|
get |
delta position from one cell to the next
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
|
get |
whether we're on a hexagonal map which may need some special handling
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
|
get |
whether the map grid is in xy, usually in 2d games
3d games often use Y as the height axis and have their grid in XZ
Implemented in CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.
|
get |
world position at the center of the map
Implemented in CityBuilderCore.HexagonMap, CityBuilderCore.IsometricMap, CityBuilderCore.MapBase, and CityBuilderCore.Tests.DebugMap.