Loading...
Searching...
No Matches
CityBuilderCore.IStructure Interface Reference

Detailed Description

interface for anything placed on the map(roads, decorators, buildings, ....)

Inheritance diagram for CityBuilderCore.IStructure:
CityBuilderCore.IKeyed CityBuilderCore.IBuilding CityBuilderCore.RoadNetwork CityBuilderCore.StructureCollection CityBuilderCore.StructureDecorators CityBuilderCore.StructureTerrainDetails CityBuilderCore.StructureTerrainTrees CityBuilderCore.StructureTiles CityBuilderCore.Tests.DebugStructure

Public Member Functions

string GetName ()
 retrieves the name of the structure for display in the UI
 
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
 

Properties

StructureReference StructureReference [get, set]
 reference to the structure that keeps working even if the structure is replaced
 
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
string Key [get]
 unique identifier among a type of objects(might be used in savegames, be careful when changing)
 

Events

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
 

Member Function Documentation

◆ Add()

void CityBuilderCore.IStructure.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

Parameters
pointsthe points that will be added to the structure

Implemented in CityBuilderCore.Building, CityBuilderCore.RoadNetwork, CityBuilderCore.StructureCollection, CityBuilderCore.StructureDecorators, CityBuilderCore.StructureTerrainDetails, CityBuilderCore.StructureTerrainTrees, CityBuilderCore.StructureTiles, and CityBuilderCore.Tests.DebugStructure.

◆ GetName()

string CityBuilderCore.IStructure.GetName ( )

◆ GetPoints()

IEnumerable< Vector2Int > CityBuilderCore.IStructure.GetPoints ( )

◆ HasPoint()

bool CityBuilderCore.IStructure.HasPoint ( Vector2Int point)

◆ Remove()

void CityBuilderCore.IStructure.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

Parameters
pointsthe points to remove

Implemented in CityBuilderCore.Building, CityBuilderCore.RoadNetwork, CityBuilderCore.StructureCollection, CityBuilderCore.StructureDecorators, CityBuilderCore.StructureTerrainDetails, CityBuilderCore.StructureTerrainTrees, CityBuilderCore.StructureTiles, and CityBuilderCore.Tests.DebugStructure.

Property Documentation

◆ IsDecorator

bool CityBuilderCore.IStructure.IsDecorator
get

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

Implemented in CityBuilderCore.Building, CityBuilderCore.RoadNetwork, and CityBuilderCore.Tests.DebugStructure.

◆ IsDestructible

bool CityBuilderCore.IStructure.IsDestructible
get

whether the structure can be removed by the player

Implemented in CityBuilderCore.Building, CityBuilderCore.RoadNetwork, and CityBuilderCore.Tests.DebugStructure.

◆ IsMovable

bool CityBuilderCore.IStructure.IsMovable
get

whether the structure can be moved by the MoveTool

Implemented in CityBuilderCore.Building, CityBuilderCore.RoadNetwork, and CityBuilderCore.Tests.DebugStructure.

◆ IsWalkable

bool CityBuilderCore.IStructure.IsWalkable
get

whether walkers can pass the points of this structure

Implemented in CityBuilderCore.Building, CityBuilderCore.RoadNetwork, CityBuilderCore.Tests.DebugBuilding, and CityBuilderCore.Tests.DebugStructure.

◆ Level

int CityBuilderCore.IStructure.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

Implemented in CityBuilderCore.RoadNetwork, and CityBuilderCore.Tests.DebugStructure.

◆ StructureReference