Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorRideOn Class Reference

Behavior adding support to actors to ride on ECBehaviorRidable. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorRideOn:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  BlockListenerFactory
 Factory creating listeners using block. More...
 
class  DefaultListener
 Default implementation of behavior instance listener. More...
 
class  Instance
 Behavior instance. More...
 
interface  Listener
 Listener for behavior instance events. More...
 
interface  ListenerFactory
 Factory creating listeners. More...
 

Public Member Functions

void addListenerFactory (Block blockFactory)
 Add listener factory using block. More...
 
void addListenerFactory (ListenerFactory factory)
 Add listener factory. More...
 
void createListeners (Instance instance)
 Create listeners from factories adding them to behavior instance. More...
 
void dispose ()
 Dispose of behavior. More...
 
void forEachListenerFactory (Block ablock)
 Visit listener factories with block with argument ListenerFactory. More...
 
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior. More...
 
ECBehaviorProjectToGround getProjectToGround ()
 Project to ground behavior. More...
 
ECBehaviorRideOn new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, ECBehaviorProjectToGround projectToGround)
 Create behavior element class. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorRideOn getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Public Attributes

Array pListenerFactories
 
ECBehaviorLocomotion pLocomotion
 
ECBehaviorProjectToGround pProjectToGround
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Behavior adding support to actors to ride on ECBehaviorRidable.

Requires these behaviors to be present:

If ECBehaviorProjectToGround and ECBehaviorColliderAI are enabled sets the ridable to the ground element if element supports ECBehaviorRidable. Otherwise clears the ridable.

Sometimes it is necessary to prevent the ridable to change although it usually would. This can be for example if an actor interacts with an object like sitting on a chair. Projecting to ground usually has to be disabled in this case to prevent the actor climbing on the chair instead of sitting on it. In general this is not a problem since the actor is usually not riding on another element. If tough the actor does ride on another element disabling projecting to ground will clear the ridable. This in turn causes the element to no more move together with the ridable element causing issues. To prevent this problem the ridable can be locked using setLocked(). While locked changes due to ECBehaviorProjectToGround changes will not cause setRidable() to be called. While locked you can still manually call setRidable() to assign a ridable of your choice.

Behavior supports persistency.

Member Function Documentation

◆ addListenerFactory() [1/2]

void Dragengine.Scenery.ECBehaviorRideOn.addListenerFactory ( Block  blockFactory)

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

void Dragengine.Scenery.ECBehaviorRideOn.addListenerFactory ( ListenerFactory  factory)

Add listener factory.

◆ createListeners()

void Dragengine.Scenery.ECBehaviorRideOn.createListeners ( Instance  instance)

Create listeners from factories adding them to behavior instance.

◆ dispose()

void Dragengine.Scenery.ECBehaviorRideOn.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachListenerFactory()

void Dragengine.Scenery.ECBehaviorRideOn.forEachListenerFactory ( Block  ablock)

Visit listener factories with block with argument ListenerFactory.

◆ getBehaviorIn()

static ECBehaviorRideOn Dragengine.Scenery.ECBehaviorRideOn.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorProjectToGround.

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorRideOn.getLocomotion ( )

Locomotion behavior.

◆ getProjectToGround()

ECBehaviorProjectToGround Dragengine.Scenery.ECBehaviorRideOn.getProjectToGround ( )

Project to ground behavior.

◆ new()

ECBehaviorRideOn Dragengine.Scenery.ECBehaviorRideOn.new ( BehaviorElementClass  eclass,
ECBehaviorLocomotion  locomotion,
ECBehaviorProjectToGround  projectToGround 
)

Create behavior element class.

Member Data Documentation

◆ pListenerFactories

Array Dragengine.Scenery.ECBehaviorRideOn.pListenerFactories

◆ pLocomotion

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorRideOn.pLocomotion

◆ pProjectToGround

ECBehaviorProjectToGround Dragengine.Scenery.ECBehaviorRideOn.pProjectToGround

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