ClassicCityBuilderKit 1.8.8
|
permanent components making up a buildings behaviour
as such they have to be added to the building transform in the building prefabs
when a building is replaced its components are destroyed with their building
onReplacing is called beforehand so the component can transfer its items and such to an equivalent component in the new building
Public Member Functions | |
void | SetupComponent () |
only called when the building is originally placed, before Initialize | |
void | InitializeComponent () |
initialization is performed when the building is placed or loaded use to create references, register traits, ... | |
void | TerminateComponent () |
termination is performed when the building is destroyed use to deregister traits, remove references from other systems | |
void | OnReplacing (IBuilding replacement) |
called when a component gets replaced use to transfer resources, replace references | |
void | OnMoving () |
called when the building is about to be moved can be used to remove/deregister stuff from the old position | |
void | OnMoved (Vector2Int oldPoint, BuildingRotation oldRotation) |
called after a building has been moved can be used to register things at the new position | |
void | SuspendComponent () |
temporarily stops the component from working | |
void | ResumeComponent () |
resumes work in the component after SuspendComponent has been called | |
string | GetDebugText () |
text displayed in scene editor | |
string | GetDescription () |
text that may be displayed in dialogs | |
Public Member Functions inherited from CityBuilderCore.ISaveData | |
string | SaveData () |
serializes the objects state(usually to json) and returns it | |
void | LoadData (string json) |
deserializes the serialized json data and loads the data as its new state | |
Properties | |
string | Key [get] |
unique key used to identify the component in save/load | |
IBuilding | Building [get, set] |
the building the component is attached to is set by the building in awake | |
string CityBuilderCore.IBuildingComponent.GetDebugText | ( | ) |
text displayed in scene editor
Implemented in CityBuilderCore.AttackableComponent, CityBuilderCore.BuildingComponent, CityBuilderCore.CollectionComponent, CityBuilderCore.DistributionComponent, CityBuilderCore.EmploymentComponent, CityBuilderCore.ItemsRetrieverComponent, CityBuilderCore.ProgressComponent, CityBuilderCore.StorageComponent, CityBuilderCore.VariantProductionComponent, CityBuilderTown.TownHomeComponent, and CityBuilderTown.TownMarketComponent.
string CityBuilderCore.IBuildingComponent.GetDescription | ( | ) |
text that may be displayed in dialogs
Implemented in CityBuilderCore.BuildingComponent, CityBuilderCore.EmploymentComponent, CityBuilderCore.EvolutionComponent, and CityBuilderCore.HousingComponent.
void CityBuilderCore.IBuildingComponent.InitializeComponent | ( | ) |
initialization is performed when the building is placed or loaded
use to create references, register traits, ...
Implemented in CityBuilderCore.AttackableComponent, CityBuilderCore.BuildingComponent, CityBuilderCore.CollectionComponent, CityBuilderCore.ConnectionFeederComponent, CityBuilderCore.ConnectionPasserComponent, CityBuilderCore.EmploymentComponent, CityBuilderCore.HousingComponent, CityBuilderCore.HousingPlaceholderComponent, CityBuilderCore.ItemEfficiencyComponent, CityBuilderCore.MonumentSiteComponent, CityBuilderCore.ProductionComponent, CityBuilderCore.ProgressComponent, CityBuilderCore.RoadBlockerComponent, CityBuilderCore.SpriteRandomizerComponent, CityBuilderCore.StorageComponent, CityBuilderCore.VariantProductionComponent, CityBuilderCore.WorkerUserComponent, CityBuilderManual.Custom.CustomBuildingTrait, CityBuilderTown.ItemConstructionComponent, CityBuilderTown.TownConstructionComponent, CityBuilderTown.TownFarmingComponent, CityBuilderTown.TownHomeComponent, CityBuilderTown.TownMarketComponent, CityBuilderTown.TownWorkComponent, CityBuilderUrban.HouseComponent, and CityBuilderUrban.ShopComponent.
void CityBuilderCore.IBuildingComponent.OnMoved | ( | Vector2Int | oldPoint, |
BuildingRotation | oldRotation ) |
called after a building has been moved
can be used to register things at the new position
oldPoint | point of the building before moving |
oldRotation | rotation of the building before moving |
Implemented in CityBuilderCore.BuildingComponent.
void CityBuilderCore.IBuildingComponent.OnMoving | ( | ) |
called when the building is about to be moved
can be used to remove/deregister stuff from the old position
Implemented in CityBuilderCore.BuildingComponent.
void CityBuilderCore.IBuildingComponent.OnReplacing | ( | IBuilding | replacement | ) |
called when a component gets replaced
use to transfer resources, replace references
replacement |
Implemented in CityBuilderCore.AttackableComponent, CityBuilderCore.BuildingComponent, CityBuilderCore.CollectionComponent, CityBuilderCore.ConnectionFeederComponent, CityBuilderCore.ConnectionPasserComponent, CityBuilderCore.EvolutionComponent, CityBuilderCore.GenerationComponent, CityBuilderCore.HousingComponent, CityBuilderCore.HousingPlaceholderComponent, CityBuilderCore.ItemEfficiencyComponent, CityBuilderCore.MonumentSiteComponent, CityBuilderCore.ProductionComponent, CityBuilderCore.RiskerComponent, CityBuilderCore.SpriteRandomizerComponent, CityBuilderCore.StorageComponent, CityBuilderCore.VariantProductionComponent, CityBuilderCore.WorkerUserComponent, CityBuilderManual.Custom.CustomBuildingTrait, CityBuilderTown.TownHomeComponent, CityBuilderTown.TownMarketComponent, CityBuilderUrban.HouseComponent, and CityBuilderUrban.ShopComponent.
void CityBuilderCore.IBuildingComponent.ResumeComponent | ( | ) |
resumes work in the component after SuspendComponent has been called
Implemented in CityBuilderCore.BuildingComponent, CityBuilderCore.RoadBlockerComponent, CityBuilderTown.TownFarmingComponent, CityBuilderTown.TownMarketComponent, CityBuilderTown.TownProductionComponent, and CityBuilderTown.TownWorkComponent.
void CityBuilderCore.IBuildingComponent.SetupComponent | ( | ) |
only called when the building is originally placed, before Initialize
Implemented in CityBuilderCore.BuildingComponent, and CityBuilderTown.TownConstructionComponent.
void CityBuilderCore.IBuildingComponent.SuspendComponent | ( | ) |
temporarily stops the component from working
Implemented in CityBuilderCore.BuildingComponent, CityBuilderCore.HousingComponent, CityBuilderCore.RoadBlockerComponent, CityBuilderTown.TownConstructionComponent, CityBuilderTown.TownFarmingComponent, CityBuilderTown.TownForestingComponent, CityBuilderTown.TownGatheringComponent, CityBuilderTown.TownHomeComponent, CityBuilderTown.TownMarketComponent, CityBuilderTown.TownProductionComponent, and CityBuilderTown.TownWorkComponent.
void CityBuilderCore.IBuildingComponent.TerminateComponent | ( | ) |
termination is performed when the building is destroyed
use to deregister traits, remove references from other systems
Implemented in CityBuilderCore.AttackableComponent, CityBuilderCore.BuildingComponent, CityBuilderCore.CollectionComponent, CityBuilderCore.ConnectionFeederComponent, CityBuilderCore.ConnectionPasserComponent, CityBuilderCore.HousingComponent, CityBuilderCore.HousingPlaceholderComponent, CityBuilderCore.ItemEfficiencyComponent, CityBuilderCore.MonumentSiteComponent, CityBuilderCore.ProductionComponent, CityBuilderCore.RoadBlockerComponent, CityBuilderCore.StorageComponent, CityBuilderCore.VariantProductionComponent, CityBuilderCore.WorkerUserComponent, CityBuilderManual.Custom.CustomBuildingTrait, CityBuilderTown.ItemConstructionComponent, CityBuilderTown.TownConstructionComponent, CityBuilderTown.TownFarmingComponent, CityBuilderTown.TownForestingComponent, CityBuilderTown.TownGatheringComponent, CityBuilderTown.TownHomeComponent, CityBuilderTown.TownMarketComponent, CityBuilderTown.TownProductionComponent, CityBuilderTown.TownWorkComponent, and CityBuilderUrban.ShopComponent.
|
getset |
the building the component is attached to
is set by the building in awake
Implemented in CityBuilderCore.BuildingComponent.
|
get |
unique key used to identify the component in save/load
Implemented in CityBuilderCore.AttackableComponent, CityBuilderCore.BuildingComponent, CityBuilderCore.CollectionComponent, CityBuilderCore.ConnectionFeederComponent, CityBuilderCore.ConnectionPasserComponent, CityBuilderCore.CyclicWorkerProviderComponent, CityBuilderCore.DefenderAreaComponent, CityBuilderCore.DefenderComponent, CityBuilderCore.DistributionComponent, CityBuilderCore.EmploymentComponent, CityBuilderCore.EmploymentWalkerComponent, CityBuilderCore.EvolutionComponent, CityBuilderCore.GenerationComponent, CityBuilderCore.HousingComponent, CityBuilderCore.HousingPlaceholderComponent, CityBuilderCore.ItemEfficiencyComponent, CityBuilderCore.ItemsRetrieverComponent, CityBuilderCore.LayerEfficiencyComponent, CityBuilderCore.MonumentSiteComponent, CityBuilderCore.PooledWorkerProviderComponent, CityBuilderCore.ProductionComponent, CityBuilderCore.RiskerComponent, CityBuilderCore.RiskWalkerComponent, CityBuilderCore.RoadBlockerComponent, CityBuilderCore.RoadSwitcherComponent, CityBuilderCore.ScoreEfficiencyComponent, CityBuilderCore.ServiceEfficiencyComponent, CityBuilderCore.ServiceWalkerComponent, CityBuilderCore.SpriteRandomizerComponent, CityBuilderCore.StorageComponent, CityBuilderCore.StorageWalkerComponent, CityBuilderCore.Tests.DebugNoEfficiencyComponent, CityBuilderCore.TimedReplacementComponent, CityBuilderCore.VariantProductionComponent, CityBuilderCore.WalkerComponent, CityBuilderCore.WorkerUserComponent, CityBuilderManual.Custom.CustomBuildingComponent, CityBuilderManual.Custom.CustomBuildingTrait, CityBuilderTown.ItemConstructionComponent, CityBuilderTown.TownConstructionComponent, CityBuilderTown.TownFarmingComponent, CityBuilderTown.TownForestingComponent, CityBuilderTown.TownGatheringComponent, CityBuilderTown.TownHomeComponent, CityBuilderTown.TownMarketComponent, CityBuilderTown.TownWorkComponent, CityBuilderUrban.HouseComponent, CityBuilderUrban.RailwayComponent, and CityBuilderUrban.ShopComponent.