SpaceRTS - Starter Pack  1.3
NullPointerGame.BuildSystem.Buildable Class Reference

GameEntityComponent that allows to this GameEntity to be builded. More...

Inheritance diagram for NullPointerGame.BuildSystem.Buildable:
GameBase.GameEntityComponent

Public Member Functions

override void OnVisualModuleSetted ()
 Called when the Visual Module is setted. Here we need to initialize all the component related functionality. More...
 
override void OnVisualModuleRemoved ()
 Called when the Visual Module is removed. Here we need to uninitialize all the component related functionality. More...
 
void SetBuilder (Builder builder)
 Sets the current assigned builder for this buildable. More...
 
void ChangeProgress (float value)
 Increases the current value of progress according with the current build time More...
 
float GetProgress ()
 Returns the normalized current percent progress of construction of this buildable. More...
 
GameEntity ChangeToFinalController ()
 

Public Attributes

UnitConfig buildType
 unit's configuration of this buildable unit. once completed will be used as base configuration for the final instantiated GameEntity. More...
 
float buildPoints = 100
 points required to build this unit. The build time will be calculated between this property and the Builder's BuildRate. More...
 
Action ConstructProgressChanged
 Triggers each time the construction progress is changed by any builder. More...
 
Action ConstructionFinished
 Triggered when the construction progress is completed. More...
 

Properties

bool HasBuilder [get]
 Returns true if this builable has a builder currently assigned. More...
 
Builder Builder [get]
 Returns true if this builable has a builder currently assigned. More...
 
bool IsConstructionFinished [get]
 Was the current build finished More...
 
UnitConfig BuildType [get]
 UnitConfig for the current type of buildable. More...
 
Parking Parking [get]
 Returns the current used parking system. More...
 
- Properties inherited from GameBase.GameEntityComponent
GameEntity ThisEntity [get]
 The GameEntity attached to this component. More...
 
MessageSink Messages [get]
 Shortcut for the Message sink located at the GameEntity attached to this component. More...
 
ComponentProxy VisualProxy [get]
 Shortcut for the ComponentProxy located at the GameEntity attached to this component. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GameBase.GameEntityComponent
virtual void SetupEntityComponent ()
 virtual class to be implemented. This will be called on the Awake to do a proper initialization of the component ensuring that the GameEntity thisEntity it's already defined at this point. Version 1.1: This will no longer be used in the future. Use instead OnVisualModuleSetted and OnVisualModuleRemoved. More...
 
virtual void OnValidate ()
 Called by unity when the script is reloaded. Here we setup the component and check that all is setted correctly. More...
 
GetSceneSystem< T > ()
 Shortcut for access a SceneSystem registered in the GameScene. More...
 
GetVisualProxyProperty< T > (string name)
 Shortcut for access the property located at the GameEntity visual module. More...
 
void LogsClear ()
 Clears all log messages More...
 
void Log (string message)
 Stores the message as a log that can be used later to show a warning in the editor or console. More...
 
void PushLogs ()
 Push all the stored logs to the console. More...
 

Detailed Description

GameEntityComponent that allows to this GameEntity to be builded.

Member Function Documentation

◆ ChangeProgress()

void NullPointerGame.BuildSystem.Buildable.ChangeProgress ( float  value)

Increases the current value of progress according with the current build time

Parameters
valueValue to increase the current progress.

◆ ChangeToFinalController()

GameEntity NullPointerGame.BuildSystem.Buildable.ChangeToFinalController ( )

◆ GetProgress()

float NullPointerGame.BuildSystem.Buildable.GetProgress ( )

Returns the normalized current percent progress of construction of this buildable.

Returns
Normalized progress of construction. 0 means not started, 1 means completed.

◆ OnVisualModuleRemoved()

override void NullPointerGame.BuildSystem.Buildable.OnVisualModuleRemoved ( )
virtual

Called when the Visual Module is removed. Here we need to uninitialize all the component related functionality.

Reimplemented from GameBase.GameEntityComponent.

◆ OnVisualModuleSetted()

override void NullPointerGame.BuildSystem.Buildable.OnVisualModuleSetted ( )
virtual

Called when the Visual Module is setted. Here we need to initialize all the component related functionality.

Reimplemented from GameBase.GameEntityComponent.

◆ SetBuilder()

void NullPointerGame.BuildSystem.Buildable.SetBuilder ( Builder  builder)

Sets the current assigned builder for this buildable.

Parameters
builderThe builder to build this buildable.

Member Data Documentation

◆ buildPoints

float NullPointerGame.BuildSystem.Buildable.buildPoints = 100

points required to build this unit. The build time will be calculated between this property and the Builder's BuildRate.

◆ buildType

UnitConfig NullPointerGame.BuildSystem.Buildable.buildType

unit's configuration of this buildable unit. once completed will be used as base configuration for the final instantiated GameEntity.

◆ ConstructionFinished

Action NullPointerGame.BuildSystem.Buildable.ConstructionFinished

Triggered when the construction progress is completed.

◆ ConstructProgressChanged

Action NullPointerGame.BuildSystem.Buildable.ConstructProgressChanged

Triggers each time the construction progress is changed by any builder.

Property Documentation

◆ Builder

Builder NullPointerGame.BuildSystem.Buildable.Builder
get

Returns true if this builable has a builder currently assigned.

◆ BuildType

UnitConfig NullPointerGame.BuildSystem.Buildable.BuildType
get

UnitConfig for the current type of buildable.

◆ HasBuilder

bool NullPointerGame.BuildSystem.Buildable.HasBuilder
get

Returns true if this builable has a builder currently assigned.

◆ IsConstructionFinished

bool NullPointerGame.BuildSystem.Buildable.IsConstructionFinished
get

Was the current build finished

◆ Parking

Parking NullPointerGame.BuildSystem.Buildable.Parking
get

Returns the current used parking system.