Loading...
Searching...
No Matches
CityBuilderCore.Tests.DebugStructure Class Reference
Inheritance diagram for CityBuilderCore.Tests.DebugStructure:
CityBuilderCore.KeyedBehaviour CityBuilderCore.IStructure CityBuilderCore.IKeyed CityBuilderCore.IKeyed

Public Member Functions

IEnumerable< Vector2Int > GetPoints ()
 retrieves all the points the structure occupies
 
bool HasPoint (Vector2Int position)
 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 > positions)
 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
 
- Properties inherited from CityBuilderCore.IKeyed
- Properties inherited from CityBuilderCore.IStructure

Events

Action< PointsChanged< IStructure > > PointsChanged [add, remove]
 
- Events inherited from CityBuilderCore.IStructure
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

- Public Attributes inherited from CityBuilderCore.KeyedBehaviour
string Key
 

Member Function Documentation

◆ Add()

void CityBuilderCore.Tests.DebugStructure.Add ( IEnumerable< Vector2Int > points)
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

Parameters
pointsthe points that will be added to the structure

Implements CityBuilderCore.IStructure.

◆ GetName()

string CityBuilderCore.Tests.DebugStructure.GetName ( )

retrieves the name of the structure for display in the UI

Returns
name of the structure for UI

Implements CityBuilderCore.IStructure.

◆ GetPoints()

IEnumerable< Vector2Int > CityBuilderCore.Tests.DebugStructure.GetPoints ( )

retrieves all the points the structure occupies

Returns
the points the structure occupies

Implements CityBuilderCore.IStructure.

◆ HasPoint()

bool CityBuilderCore.Tests.DebugStructure.HasPoint ( Vector2Int point)

checks if the structure occupies a certain point

Parameters
pointa point on the map
Returns
true if the structure occupies that point

Implements CityBuilderCore.IStructure.

◆ Remove()

void CityBuilderCore.Tests.DebugStructure.Remove ( IEnumerable< Vector2Int > points)
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

Parameters
pointsthe points to remove

Implements CityBuilderCore.IStructure.

Property Documentation

◆ IsDecorator

bool CityBuilderCore.Tests.DebugStructure.IsDecorator
get

whether the structure is automatically removed when something is built on top of it

Implements CityBuilderCore.IStructure.

◆ IsDestructible

bool CityBuilderCore.Tests.DebugStructure.IsDestructible
get

whether the structure can be removed by the player

Implements CityBuilderCore.IStructure.

◆ IsMovable

bool CityBuilderCore.Tests.DebugStructure.IsMovable
get

whether the structure can be moved by the MoveTool

Implements CityBuilderCore.IStructure.

◆ IsWalkable

bool CityBuilderCore.Tests.DebugStructure.IsWalkable
get

whether walkers can pass the points of this structure

Implements CityBuilderCore.IStructure.

◆ Level

int CityBuilderCore.Tests.DebugStructure.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

Implements CityBuilderCore.IStructure.

◆ StructureReference

StructureReference CityBuilderCore.Tests.DebugStructure.StructureReference
getset

reference to the structure that keeps working even if the structure is replaced

Implements CityBuilderCore.IStructure.