Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.GWBehaviorAnchoredElements Class Reference

GameWorld Behavior adding support for anchoring elements. More...

Inheritance diagram for Dragengine.Scenery.GWBehaviorAnchoredElements:
Dragengine.Scenery.DefaultGWBehavior Dragengine.Scenery.GWBehavior

Public Member Functions

void addGroupElement (StringID group, Element element)
 Add element to anchor group if absent.
void dispose ()
 Dispose of behavior.
Element findGroupElement (StringID group, Block ablock)
 Find elements in anchor group with block.
void forEachGroupElement (StringID group, Block ablock)
 Visit anchor group elements with block with parameter Element.
Array getAllGroupIDs ()
 Array of StringID of all anchor group identifiers.
AnchoredElementList getElements ()
 Anchored element list.
int getGroupElementCount (StringID group)
 Count of elements in anchor group.
bool hasGroupElement (StringID group, Element element)
 Element is present in anchor group.
GWBehaviorAnchoredElements new (GameWorld gameWorld)
 Create element.
void removeAllGroupElements (StringID group)
 Remove all elements from anchor group.
void removeGroupElement (StringID group, Element element)
 Remove element from anchor group if present.
Public Member Functions inherited from Dragengine.Scenery.DefaultGWBehavior
String getBehaviorID ()
 Unique identifier of behavior.
GameWorld getGameWorld ()
 Game world this behavior belongs to.
String getID ()
 Identifier.
void init (StubGameWorld stub)
 Initialize game world from stub.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader)
 Load data of another behavior.
DefaultGWBehavior new (GameWorld gameWorld, String id)
 Create default behavior.
void postThink (float elapsed)
 Post thinking after physics processing is finished.
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read from file.
bool requiresPersistency ()
 Behavior requires readFromFile() and writeToFile() to be called.
bool requiresThink ()
 Behavior instance requires update(), think() and postThink() to be called.
bool supportsBehaviorID (String identifier)
 Behavior supports loading data of another behavior.
void think (float elapsed)
 Think about what to do for the next frame update.
void update (float elapsed)
 Frame update.
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write to file.

Static Public Member Functions

static GWBehaviorAnchoredElements getBehaviorIn (GameWorld gameWorld)
 Get behavior in game world or null if absent.

Public Attributes

AnchoredElementList pElements
Dictionary pGroups

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultGWBehavior
void setBehaviorID (String identifier)
 Set behavior identifier.
void setRequiresPersistency (bool required)
 Set if behavior requires readFromFile() and writeToFile() to be called.
void setRequiresThink (bool required)
 Set if behavior instance requires update(), think() and postThink() to be called.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

Detailed Description

GameWorld Behavior adding support for anchoring elements.

Version
1.35

Mainly used by ECBehaviorAnchorElement and ECABehaviorAnchorElement but elements can be manually anchored and unanchored.

This behavior can be present only once in a GameWorld.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:gwbehavior_anchoredelements

Member Function Documentation

◆ addGroupElement()

void Dragengine.Scenery.GWBehaviorAnchoredElements.addGroupElement ( StringID group,
Element element )

Add element to anchor group if absent.

Referenced by forEachGroupElement().

◆ dispose()

void Dragengine.Scenery.GWBehaviorAnchoredElements.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultGWBehavior.

References dispose().

Referenced by dispose(), and getElements().

◆ findGroupElement()

Element Dragengine.Scenery.GWBehaviorAnchoredElements.findGroupElement ( StringID group,
Block ablock )

Find elements in anchor group with block.

Block is called with arguments StringID (identifier) and Element. Block has to return true if the element has been found.

References new().

Referenced by getBehaviorIn().

◆ forEachGroupElement()

void Dragengine.Scenery.GWBehaviorAnchoredElements.forEachGroupElement ( StringID group,
Block ablock )

Visit anchor group elements with block with parameter Element.

References addGroupElement(), hasGroupElement(), and pGroups.

Referenced by getBehaviorIn().

◆ getAllGroupIDs()

Array Dragengine.Scenery.GWBehaviorAnchoredElements.getAllGroupIDs ( )

Array of StringID of all anchor group identifiers.

References new(), and pGroups.

Referenced by getBehaviorIn().

◆ getBehaviorIn()

GWBehaviorAnchoredElements Dragengine.Scenery.GWBehaviorAnchoredElements.getBehaviorIn ( GameWorld gameWorld)
static

Get behavior in game world or null if absent.

Use this method to check if GameWorld contains behavior of type GWBehaviorAnchoredElements.

References findGroupElement(), forEachGroupElement(), getAllGroupIDs(), getBehaviorIn(), pGroups, removeAllGroupElements(), and removeGroupElement().

Referenced by getBehaviorIn().

◆ getElements()

AnchoredElementList Dragengine.Scenery.GWBehaviorAnchoredElements.getElements ( )

Anchored element list.

References dispose(), pElements, and pGroups.

Referenced by hasGroupElement().

◆ getGroupElementCount()

int Dragengine.Scenery.GWBehaviorAnchoredElements.getGroupElementCount ( StringID group)

Count of elements in anchor group.

Referenced by removeGroupElement().

◆ hasGroupElement()

bool Dragengine.Scenery.GWBehaviorAnchoredElements.hasGroupElement ( StringID group,
Element element )

Element is present in anchor group.

References getElements(), and pElements.

Referenced by forEachGroupElement().

◆ new()

GWBehaviorAnchoredElements Dragengine.Scenery.GWBehaviorAnchoredElements.new ( GameWorld gameWorld)

Create element.

Reimplemented from Dragengine.Scenery.DefaultGWBehavior.

References new(), pElements, and pGroups.

Referenced by findGroupElement(), getAllGroupIDs(), and new().

◆ removeAllGroupElements()

void Dragengine.Scenery.GWBehaviorAnchoredElements.removeAllGroupElements ( StringID group)

Remove all elements from anchor group.

Referenced by getBehaviorIn().

◆ removeGroupElement()

void Dragengine.Scenery.GWBehaviorAnchoredElements.removeGroupElement ( StringID group,
Element element )

Remove element from anchor group if present.

References getGroupElementCount(), and pGroups.

Referenced by getBehaviorIn().

Member Data Documentation

◆ pElements

AnchoredElementList Dragengine.Scenery.GWBehaviorAnchoredElements.pElements

Referenced by getElements(), hasGroupElement(), and new().

◆ pGroups

Dictionary Dragengine.Scenery.GWBehaviorAnchoredElements.pGroups

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