SpaceRTS - Starter Pack  1.3
GameBase.GameEntity Class Reference

Core Component for each interactable Entity in the Game. Acts as a Controller for the visual Avatar through its ComponentProxy. More...

Inheritance diagram for GameBase.GameEntity:

Public Member Functions

void ChangeVisualModule (ComponentProxy newVisualModule)
 Change the visual module of this GameEntity. If already has a reference to a module than notifies to each GameEntityComponent that the VisualModule has been removed. Then assign the new module and notifies to each GameEntityComponent that a visual module has been set. More...
 
GetSceneSystem< T > ()
 Returns a casted GameSceneSystem. More...
 

Static Public Member Functions

static IEnumerable< T > Collect< T > (IEnumerable< GameEntity > entities)
 Collects all the components of type T from each GameEntity. Note that will return only components in the same GameObject of GameEntity and if they are found. More...
 

Public Attributes

ComponentProxy visualModule
 Reference to the ComponentProxy located at the root of the controlled Avatar. More...
 

Protected Member Functions

virtual void Start ()
 Initialize the GameScene reference and if there is a VisualModule then notifies to each GameEntityComponent that it can initialize their own systems. More...
 
virtual void OnDestroy ()
 

Properties

MessageSink Messages [get]
 Returns the MessageSink class that belongs to this GameEntity. More...
 
ComponentProxy VisualProxy [get]
 Returns the ComponentProxy (View) for this GameEntity (Controller) More...
 
GameScene GameScene [get]
 Returns the GameScene where is located this GameEntity. More...
 

Detailed Description

Core Component for each interactable Entity in the Game. Acts as a Controller for the visual Avatar through its ComponentProxy.

Member Function Documentation

◆ ChangeVisualModule()

void GameBase.GameEntity.ChangeVisualModule ( ComponentProxy  newVisualModule)

Change the visual module of this GameEntity. If already has a reference to a module than notifies to each GameEntityComponent that the VisualModule has been removed. Then assign the new module and notifies to each GameEntityComponent that a visual module has been set.

Parameters
newVisualModule

◆ Collect< T >()

static IEnumerable<T> GameBase.GameEntity.Collect< T > ( IEnumerable< GameEntity entities)
static

Collects all the components of type T from each GameEntity. Note that will return only components in the same GameObject of GameEntity and if they are found.

Template Parameters
T
Parameters
entitiesCollection of GameEntity where to find the components.
Returns
A collection of components of type T .

◆ GetSceneSystem< T >()

T GameBase.GameEntity.GetSceneSystem< T > ( )

Returns a casted GameSceneSystem.

Template Parameters
Tmust inherit from GameSceneSystem.
Returns
The casted reference to the wanted game system or default(T) if isn't found.
Type Constraints
T :GameSceneSystem 

◆ OnDestroy()

virtual void GameBase.GameEntity.OnDestroy ( )
protectedvirtual

◆ Start()

virtual void GameBase.GameEntity.Start ( )
protectedvirtual

Initialize the GameScene reference and if there is a VisualModule then notifies to each GameEntityComponent that it can initialize their own systems.

Member Data Documentation

◆ visualModule

ComponentProxy GameBase.GameEntity.visualModule

Reference to the ComponentProxy located at the root of the controlled Avatar.

Property Documentation

◆ GameScene

GameScene GameBase.GameEntity.GameScene
get

Returns the GameScene where is located this GameEntity.

◆ Messages

MessageSink GameBase.GameEntity.Messages
get

Returns the MessageSink class that belongs to this GameEntity.

◆ VisualProxy

ComponentProxy GameBase.GameEntity.VisualProxy
get

Returns the ComponentProxy (View) for this GameEntity (Controller)