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

Detailed Description

the component that tracks all the buildings in the game

Inheritance diagram for CityBuilderCore.IBuildingManager:
CityBuilderCore.DefaultBuildingManager

Public Member Functions

Add< T > (Vector3 position, Quaternion rotation, T prefab, Action< T > initializer=null)
 creates a new building
 
void RegisterBuilding (IBuilding building)
 registers a building into the managers responsibility, called by building on initialization
 
void DeregisterBuilding (IBuilding building)
 deregisters a building from the managers responsibility, called by building on termination
 
BuildingComponentReference< T > RegisterBuildingTrait< T > (T component)
 registers a trait with the manager so the trait can be easily retrieved from outside
 
void ReplaceBuildingTrait< T > (T component, T replacement)
 replace a trait in its reference or remove it if there is no replacement, called by the component on replacement
 
void DeregisterBuildingTrait< T > (T component)
 deregister a trait from the manager, called by the component on termination
 
int Count (BuildingInfo info)
 
int Count (BuildingCategory buildingCategory)
 
IEnumerable< IBuildingGetBuilding (Vector2Int point)
 returns a building at the point, can be any point in the building not just the origin
 
BuildingReference GetBuildingReference (Guid id)
 retrieve building by its id, may be used to get building references when loading
 
IEnumerable< IBuildingGetBuildings ()
 
IEnumerable< IBuildingGetBuildings (BuildingCategory category)
 
IEnumerable< IBuildingGetBuildings (BuildingInfo info)
 
IEnumerable< T > GetBuildingTraits< T > ()
 
bool HasEvolutionDelay (bool direction)
 
float GetEvolutionDelay (bool direction)
 
string AddEvolutionAddon (IBuilding building, bool direction)
 
string AddSuspensionAddon (IBuilding building)
 
string SaveData ()
 
void LoadData (string json)
 

Events

Action< IBuildingAdded
 fired after a new building has been instantiated and initialized
 
Action< IBuildingRegistered
 fired when a new building is registered(happens during initializion)
 
Action< IBuildingDeregistered
 fired when a building gets deregistered(happens during termination)
 

Member Function Documentation

◆ Add< T >()

T CityBuilderCore.IBuildingManager.Add< T > ( Vector3 position,
Quaternion rotation,
T prefab,
Action< T > initializer = null )

creates a new building

Template Parameters
T
Parameters
origin
rotation
prefab
Returns

Implemented in CityBuilderCore.DefaultBuildingManager.

Type Constraints
T :Building 

◆ DeregisterBuilding()

void CityBuilderCore.IBuildingManager.DeregisterBuilding ( IBuilding building)

deregisters a building from the managers responsibility, called by building on termination

Parameters
building

Implemented in CityBuilderCore.DefaultBuildingManager.

◆ DeregisterBuildingTrait< T >()

void CityBuilderCore.IBuildingManager.DeregisterBuildingTrait< T > ( T component)

deregister a trait from the manager, called by the component on termination

Template Parameters
T
Parameters
component

Implemented in CityBuilderCore.DefaultBuildingManager.

Type Constraints
T :IBuildingTrait<T> 

◆ GetBuilding()

IEnumerable< IBuilding > CityBuilderCore.IBuildingManager.GetBuilding ( Vector2Int point)

returns a building at the point, can be any point in the building not just the origin

Parameters
point
Returns

Implemented in CityBuilderCore.DefaultBuildingManager.

◆ GetBuildingReference()

BuildingReference CityBuilderCore.IBuildingManager.GetBuildingReference ( Guid id)

retrieve building by its id, may be used to get building references when loading

Parameters
id
Returns

Implemented in CityBuilderCore.DefaultBuildingManager.

◆ GetBuildingTraits< T >()

IEnumerable< T > CityBuilderCore.IBuildingManager.GetBuildingTraits< T > ( )
Type Constraints
T :IBuildingTrait<T> 

◆ RegisterBuilding()

void CityBuilderCore.IBuildingManager.RegisterBuilding ( IBuilding building)

registers a building into the managers responsibility, called by building on initialization

Parameters
building

Implemented in CityBuilderCore.DefaultBuildingManager.

◆ RegisterBuildingTrait< T >()

BuildingComponentReference< T > CityBuilderCore.IBuildingManager.RegisterBuildingTrait< T > ( T component)

registers a trait with the manager so the trait can be easily retrieved from outside

Template Parameters
T
Parameters
component
Returns

Implemented in CityBuilderCore.DefaultBuildingManager.

Type Constraints
T :IBuildingTrait<T> 

◆ ReplaceBuildingTrait< T >()

void CityBuilderCore.IBuildingManager.ReplaceBuildingTrait< T > ( T component,
T replacement )

replace a trait in its reference or remove it if there is no replacement, called by the component on replacement

Template Parameters
T
Parameters
component
replacement

Implemented in CityBuilderCore.DefaultBuildingManager.

Type Constraints
T :IBuildingTrait<T>