Nebula
Loading...
Searching...
No Matches
Nebula.Game.ActionProperty Class Reference

Detailed Description

A property that an ActionQueue runs.

It is active only while it is the front of its entity's queue. The queue does not run the property: it says which property is at the front, and the entity's activation pass is what activates it. An implementation says its action is done by answering true to ShouldDeactivate, and the queue moves on once the property is no longer running.

A property that is taken off its entity while it is at the front of the queue leaves the queue when the queue next looks at it.

Inherits Nebula.Game.Property.

Public Member Functions

override bool ShouldActivate ()
 A property in a queue runs when the queue says it is at the front.
void BecomeFrontOfQueue ()
 Called by the queue when this property becomes the action at the front of it.
void RemovedFromQueue ()
 Called by the queue when this property is no longer the action at the front of it.
virtual void OnBecomeFrontOfQueue ()
 Override in subclass for what the property does when it becomes the front of the queue.
virtual void OnRemovedFromQueue ()
 Override in subclass for what the property does when it is taken out of the queue.
Public Member Functions inherited from Nebula.Game.Property
virtual bool ShouldDeactivate ()
 Override in subclass to tell the entity that this property should stop running.
virtual Nebula.Game.FrameEvent[] AcceptedEvents ()
 Override in subclass to tell the property manager which methods to call for this class.
virtual uint FixedTimeSource ()
 The time source this property's fixed events run on.
virtual void OnMessage (in Msg msg)
 Called when a message is sent to the property's associated entity.
override string ToString ()
 String representation of this property.
virtual void OnActivate ()
 Called when the property is attached to an entity, or when Property.Active is changed to true.
virtual void OnDeactivate ()
 Called when the property is detached from an entity, or when Property.Active is changed to false.
virtual void OnBeginFrame ()
 Called once every frame at the beginning of the frame.
virtual void OnFixedFrame ()
 Called once for every fixed step the time source has available this frame.
virtual void OnFrame ()
 Called once every frame.
virtual void OnPhysicsFrame ()
 Called once for every step the physics time source has available this frame.
virtual void OnEndFrame ()
 Called once every frame at the end of the frame.
void Destroy ()
 Destroys the property.

Properties

bool IsFrontOfQueue [get]
 Whether this property is the action at the front of its queue.
Properties inherited from Nebula.Game.Property
bool Active [get, set]
 Activate or deactivate property This is not trivial and can potentially be costly.
bool RequestedActive [get]
 What the property was asked to be, which is what a world that starts simulating activates its properties from.
Entity Entity [get, set]
 The entity that owns this property.

Private Attributes

bool isFrontOfQueue

Additional Inherited Members

Protected Member Functions inherited from Nebula.Game.Property
virtual void RegisterMessages ()
void RegisterMessage< T > ()
Package Functions inherited from Nebula.Game.Property
bool IsSimulating ()
 Whether the property's world is simulating.
void Activate ()
 Runs OnActivate and records that it has run.
void Deactivate ()
 Runs OnDeactivate for a property that was activated.
bool AskActivate ()
 The activation gate, with the fault guard around the plugin's answer.
bool AskDeactivate ()
FrameEvent[] GetAcceptedEvents ()
 The events this property is registered for, which is what the property manager calls it for.
void AttachMessages ()
void DetachMessages ()

Member Function Documentation

◆ BecomeFrontOfQueue()

void Nebula.Game.ActionProperty.BecomeFrontOfQueue ( )
inline

Called by the queue when this property becomes the action at the front of it.

◆ OnBecomeFrontOfQueue()

virtual void Nebula.Game.ActionProperty.OnBecomeFrontOfQueue ( )
inlinevirtual

Override in subclass for what the property does when it becomes the front of the queue.

◆ OnRemovedFromQueue()

virtual void Nebula.Game.ActionProperty.OnRemovedFromQueue ( )
inlinevirtual

Override in subclass for what the property does when it is taken out of the queue.

◆ RemovedFromQueue()

void Nebula.Game.ActionProperty.RemovedFromQueue ( )
inline

Called by the queue when this property is no longer the action at the front of it.

◆ ShouldActivate()

override bool Nebula.Game.ActionProperty.ShouldActivate ( )
inlinevirtual

A property in a queue runs when the queue says it is at the front.

Reimplemented from Nebula.Game.Property.

Member Data Documentation

◆ isFrontOfQueue

bool Nebula.Game.ActionProperty.isFrontOfQueue
private

Property Documentation

◆ IsFrontOfQueue

bool Nebula.Game.ActionProperty.IsFrontOfQueue
get

Whether this property is the action at the front of its queue.


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