ClassicCityBuilderKit 1.9.1
|
Public Member Functions | |
IEnumerable< Vector2Int > | GetPoints () |
retrieves all the points the structure occupies | |
bool | HasPoint (Vector2Int point) |
checks if the structure occupies a certain point | |
void | Add (IEnumerable< Vector2Int > points) |
adds points to a structure, for example a tree to a tree structure collection this may not be possible for structures with fixed points like buildings typically called in a structures Start method | |
void | Remove (IEnumerable< Vector2Int > points) |
removes points from the structure, for some structures like buildings removing any point will remove the whole thing typically called in a structures OnDestroy method | |
string | GetName () |
retrieves the name of the structure for display in the UI | |
Properties | |
StructureReference | StructureReference [get, set] |
reference to the structure that keeps working even if the structure is replaced | |
Transform | Root [get] |
bool | IsDestructible [get] |
whether the structure can be removed by the player | |
bool | IsMovable [get] |
whether the structure can be moved by the MoveTool | |
bool | IsDecorator [get] |
whether the structure is automatically removed when something is built on top of it | |
bool | IsWalkable [get] |
whether walkers can pass the points of this structure | |
int | Level [get] |
the structure level mask of this structure determines which levels a structure occupies structures that have no levels in common can be placed on top of each other | |
![]() | |
![]() |
Events | |
Action< PointsChanged< IStructure > > | PointsChanged [add, remove] |
![]() | |
Action< PointsChanged< IStructure > > | PointsChanged |
has to be fired when a structures points changed so the manager can readjust paths only viable for structures that are stored in list form like underlying, collections and tiles other structures have to be reregistered | |
Additional Inherited Members | |
![]() | |
static void | ReplacePoints (IStructure a, IStructure b, Vector2Int point, bool keepRandomization=true, bool keepVariant=true) |
removes a point from one structure and adds it to another while trying to carry over its look both structures need to be StructureCollectionFloat, StructureTerrainTrees or StructureTerrainTreeVariants) | |
static void | ReplacePoints (IStructure a, IStructure b, IEnumerable< Vector2Int > points, bool keepRandomization=true, bool keepVariant=true) |
removes points from one structure and adds them to another while trying to carry over its look both structures need to be StructureCollectionFloat, StructureTerrainTrees or StructureTerrainTreeVariants) used in town so bushes keep their look(size, rotation, color) when berries grown on them would also carry the variant index for trees in town if there were any | |
![]() | |
string | Key |
|
inline |
adds points to a structure, for example a tree to a tree structure collection
this may not be possible for structures with fixed points like buildings
typically called in a structures Start method
points | the points that will be added to the structure |
Implements CityBuilderCore.IStructure.
string CityBuilderCore.Tests.DebugStructure.GetName | ( | ) |
retrieves the name of the structure for display in the UI
Implements CityBuilderCore.IStructure.
IEnumerable< Vector2Int > CityBuilderCore.Tests.DebugStructure.GetPoints | ( | ) |
retrieves all the points the structure occupies
Implements CityBuilderCore.IStructure.
bool CityBuilderCore.Tests.DebugStructure.HasPoint | ( | Vector2Int | point | ) |
checks if the structure occupies a certain point
point | a point on the map |
Implements CityBuilderCore.IStructure.
|
inline |
removes points from the structure, for some structures like buildings removing any point will remove the whole thing
typically called in a structures OnDestroy method
points | the points to remove |
Implements CityBuilderCore.IStructure.
|
get |
whether the structure is automatically removed when something is built on top of it
Implements CityBuilderCore.IStructure.
|
get |
whether the structure can be removed by the player
Implements CityBuilderCore.IStructure.
|
get |
whether the structure can be moved by the MoveTool
Implements CityBuilderCore.IStructure.
|
get |
whether walkers can pass the points of this structure
Implements CityBuilderCore.IStructure.
|
get |
the structure level mask of this structure
determines which levels a structure occupies
structures that have no levels in common can be placed on top of each other
Implements CityBuilderCore.IStructure.
|
getset |
reference to the structure that keeps working even if the structure is replaced
Implements CityBuilderCore.IStructure.