AlphaFramework API  1.0.3
Classes | Public Member Functions | Static Public Member Functions | Properties | List of all members
AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate > Class Template Referenceabstract

A common base class for Positionable<TCoordinates> whose behaviour and graphical representation is controlled by components. More...

Inheritance diagram for AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >:
AlphaFramework.World.Positionables.Positionable< TCoordinates > AlphaFramework.World.Positionables.IUpdateable AlphaFramework.World.Positionables.ITemplated NanoByte::Common::ICloneable< T >

Public Member Functions

abstract void Update (double elapsedTime)
 Updates the position and other attributes of this entity. More...
 
override string ToString ()
 
override Positionable< TCoordinates > Clone ()
 Creates a deep copy of this EntityBase<TCoordinates,TTemplate>. More...
 
- Public Member Functions inherited from AlphaFramework.World.Positionables.Positionable< TCoordinates >
override string ToString ()
 

Static Public Member Functions

static IDisposable MaskTemplateData ()
 Makes all TemplateData values return null until IDisposable.Dispose is called on the returned object. This is not thread-safe! More...
 

Properties

string TemplateName [get, set]
 The name of the TTemplate . More...
 
TTemplate? TemplateData [get, set]
 The TTemplate controlling the behavior and look for this EntityBase<TCoordinates,TTemplate>. More...
 
StoredPath< TCoordinates > CurrentPath [get, set]
 The path this entity is currently walking along. More...
 
- Properties inherited from AlphaFramework.World.Positionables.Positionable< TCoordinates >
string Name [get, set]
 Used for identification in scripts, debugging, etc. More...
 
TCoordinates Position [get, set]
 The Positionable<TCoordinates>'s position. More...
 
- Properties inherited from AlphaFramework.World.Positionables.ITemplated
string TemplateName [get, set]
 The name of the template. More...
 

Additional Inherited Members

- Protected Member Functions inherited from AlphaFramework.World.Positionables.Positionable< TCoordinates >
virtual void OnChanged ()
 To be called when a property relevant for rendering has changed. More...
 
void OnChangedRebuild ()
 To be called when a property has changed that requires visual representations to rebuilt from scratch (usually a template). More...
 
- Events inherited from AlphaFramework.World.Positionables.Positionable< TCoordinates >
Action< Positionable< TCoordinates > > Changed
 Occurs when a property relevant for rendering has changed. More...
 
Action< Positionable< TCoordinates > > ChangedRebuild
 Occurs when a property has changed that requires visual representations to rebuilt from scratch (usually a template). More...
 

Detailed Description

A common base class for Positionable<TCoordinates> whose behaviour and graphical representation is controlled by components.

Template Parameters
TCoordinatesData type for storing position coordinates of objects in the game world.
TTemplateThe specific type of EntityTemplateBase<TSelf> to use as a component container.
Type Constraints
TCoordinates :struct 
TTemplate :EntityTemplateBase<TTemplate> 

Member Function Documentation

◆ Clone()

override Positionable<TCoordinates> AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >.Clone ( )
inlinevirtual

Creates a deep copy of this EntityBase<TCoordinates,TTemplate>.

Returns
The cloned EntityBase<TCoordinates,TTemplate>.

Reimplemented from AlphaFramework.World.Positionables.Positionable< TCoordinates >.

◆ MaskTemplateData()

static IDisposable AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >.MaskTemplateData ( )
inlinestatic

Makes all TemplateData values return null until IDisposable.Dispose is called on the returned object. This is not thread-safe!

◆ Update()

abstract void AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >.Update ( double  elapsedTime)
pure virtual

Updates the position and other attributes of this entity.

Parameters
elapsedTimeHow much game time in seconds has elapsed since this method was last called.

Implements AlphaFramework.World.Positionables.IUpdateable.

Property Documentation

◆ CurrentPath

StoredPath<TCoordinates> AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >.CurrentPath
getset

The path this entity is currently walking along.

◆ TemplateData

TTemplate? AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >.TemplateData
getset

The TTemplate controlling the behavior and look for this EntityBase<TCoordinates,TTemplate>.

This is always a clone of the original TTemplate . This is serialized/stored in savegames but not in map files!

◆ TemplateName

string AlphaFramework.World.Positionables.EntityBase< TCoordinates, TTemplate >.TemplateName
getset

The name of the TTemplate .

Setting this will overwrite TemplateData with a new clone of the appropriate TTemplate . This is serialized/stored in map files. It is also serialized/stored in savegames, but the value is ignored there (due to the attribute order)!


The documentation for this class was generated from the following file: