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

Stub for an element. More...

Inheritance diagram for Dragengine.Preloading.StubElement:
Dragengine.Preloading.StubWithProperties Dragengine.Preloading.StubElementClassNotFound

Public Member Functions

void addAttachableBehavior (String factoryId)
 Add attachable behavior.
void createAndAddElement (GameWorld gameWorld)
 Create element and add it to game world.
void forEachAttachableBehavior (Block ablock)
 Visit attachable behaviors using block.
void forEachTexture (Block ablock)
 Visit textures with a block.
UniqueID getAttachTo ()
 Identifier of object to attach to once added to a game world.
Connection getConnection ()
 Connection to server or or null.
bool getEnableNetworking ()
 Enable networking for this stub.
UniqueID getID ()
 Unique identifier of object.
DMatrix getMatrix ()
 Stub matrix.
NetworkState getNetworkState ()
 Network state provided by server or null.
DVector getPosition ()
 Position.
Vector getRotation ()
 Rotation.
Vector getScaling ()
 Scaling if sizable.
StubElementTexture getTextureAt (int index)
 Texture at index.
int getTextureCount ()
 Number of textures.
StubElementTexture getTextureNamed (String name)
 Named texture or null if not found.
void loadAndAddElement (PersistencyEnvironment env, FileReader reader, GameWorld gameWorld)
 Load element using file reader and add it to game world.
Element loadElement (PersistencyEnvironment env, FileReader reader)
 Load element using file reader.
StubElement new (ElementClass eclass)
 Create element stub.
StubElement new (ElementClass eclass, UniqueID id)
 Create element stub.
StubElement new (ElementClass eclass, UniqueID id, StubWithProperties properties)
 Create element stub.
StubElement new (StubElement stub)
 Create copy of element stub.
void preloadResources ()
 Preload resources.
void removeAllAttachableBehaviors ()
 Remove all attachable behaviors.
void removeAllTextures ()
 Remove all textures.
void removeAttachableBehavior (String factoryId)
 Remove attachable behavior.
void removeTexture (StubElementTexture texture)
 Remove texture.
void setAttachTo (UniqueID id)
 Set dentifier of object to attach to once added to a game world.
void setClass (ElementClass elementClass)
 Set element class.
void setConnection (Connection connection)
 Set connection to server or null.
void setEnableNetworking (bool enable)
 Set if networking is enabled for this stub.
void setID (UniqueID id)
 Set unique identifier of object.
void setNetworkState (NetworkState networkState)
 Set network state provided by server or null.
void setPosition (DVector position)
 Set position.
void setRotation (Vector rotation)
 Set rotation.
void setScaling (Vector scaling)
 Set scaling if sizable.
void writeToFile (FileWriter writer)
 Write stub to file.
Public Member Functions inherited from Dragengine.Preloading.StubWithProperties
Dictionary getProperties ()
 Copy of all properties as dictionary mapping String key to String value.
bool getPropertyBoolFor (String key, bool default)
 Boolean property value or default value if absent.
int getPropertyCount ()
 Number of properties.
float getPropertyFloatFor (String key, float default)
 Floating point property value or default value if absent.
int getPropertyIntFor (String key, int default)
 Integer property value or default value if absent.
Array getPropertyKeys ()
 Property keys (String array).
String getPropertyValueFor (String key, String default)
 Value of property or default value if absent.
bool hasPropertyWithKey (String key)
 Property key is present.
StubWithProperties new ()
 Create stub with properties.
StubWithProperties new (StubWithProperties stub)
 Create copy of stub with properties.
void readPropertiesFromFile (FileReader reader)
 Read properties from file.
void removeAllProperties ()
 Remove all properties.
void removePropertyWithKey (String key)
 Remove property if present.
void setFrom (Dictionary properties)
 Set all properties from dictionary mapping String key to String value.
void setFrom (StubWithProperties properties)
 Set properties from another StubWithProperties.
void setPropertyBoolFor (String key, bool value)
 Set property.
void setPropertyFloatFor (String key, float value)
 Set property.
void setPropertyIntFor (String key, int value)
 Set property.
void setPropertyValueFor (String key, String value)
 Set property.
void writePropertiesToFile (FileWriter writer)
 Write properties to file.

Static Public Member Functions

static StubElement readFromFile (FileReader reader, ElementClassList elementClassList)
 Read stub from file.

Public Attributes

Array pAddAttachableBehaviors
ElementClass pClass
Connection pConnection
PreloadCounter pCounter
bool pEnableNetworking
UniqueID pID
DMatrix pMatrix
NetworkState pNetworkState
DVector pPosition
Vector pRotation
Array pTextures
Public Attributes inherited from Dragengine.Preloading.StubWithProperties
Dictionary pProperties
 Properties.

Detailed Description

Stub for an element.

Used during asynchronous loading to hold the settings of an element until all resources have been loaded. The network connection parameters are present only during creation time and are not persisted.

Member Function Documentation

◆ addAttachableBehavior()

void Dragengine.Preloading.StubElement.addAttachableBehavior ( String factoryId)

Add attachable behavior.

Version
1.29

References pMatrix.

Referenced by writeToFile().

◆ createAndAddElement()

void Dragengine.Preloading.StubElement.createAndAddElement ( GameWorld gameWorld)

Create element and add it to game world.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

References getAttachTo().

Referenced by writeToFile().

◆ forEachAttachableBehavior()

void Dragengine.Preloading.StubElement.forEachAttachableBehavior ( Block ablock)

Visit attachable behaviors using block.

Version
1.29

Block has signature (String) or (int, String).

References new(), and setID().

Referenced by writeToFile().

◆ forEachTexture()

void Dragengine.Preloading.StubElement.forEachTexture ( Block ablock)

Visit textures with a block.

References new(), pRotation, and setRotation().

Referenced by writeToFile().

◆ getAttachTo()

UniqueID Dragengine.Preloading.StubElement.getAttachTo ( )

Identifier of object to attach to once added to a game world.

References pTextures.

Referenced by createAndAddElement().

◆ getConnection()

Connection Dragengine.Preloading.StubElement.getConnection ( )

Connection to server or or null.

Referenced by loadAndAddElement().

◆ getEnableNetworking()

bool Dragengine.Preloading.StubElement.getEnableNetworking ( )

Enable networking for this stub.

References pPosition.

Referenced by writeToFile().

◆ getID()

UniqueID Dragengine.Preloading.StubElement.getID ( )

Unique identifier of object.

Referenced by removeAllAttachableBehaviors().

◆ getMatrix()

DMatrix Dragengine.Preloading.StubElement.getMatrix ( )

Stub matrix.

Version
1.23

References new(), and pAddAttachableBehaviors.

Referenced by removeAttachableBehavior().

◆ getNetworkState()

NetworkState Dragengine.Preloading.StubElement.getNetworkState ( )

Network state provided by server or null.

References pClass.

Referenced by writeToFile().

◆ getPosition()

DVector Dragengine.Preloading.StubElement.getPosition ( )

Position.

References new(), pAddAttachableBehaviors, and pEnableNetworking.

Referenced by setNetworkState().

◆ getRotation()

Vector Dragengine.Preloading.StubElement.getRotation ( )

◆ getScaling()

Vector Dragengine.Preloading.StubElement.getScaling ( )

Scaling if sizable.

References pPosition, and pRotation.

Referenced by removeTexture().

◆ getTextureAt()

StubElementTexture Dragengine.Preloading.StubElement.getTextureAt ( int index)

Texture at index.

References getRotation().

Referenced by writeToFile().

◆ getTextureCount()

int Dragengine.Preloading.StubElement.getTextureCount ( )

Number of textures.

References pMatrix, and pPosition.

Referenced by writeToFile().

◆ getTextureNamed()

StubElementTexture Dragengine.Preloading.StubElement.getTextureNamed ( String name)

Named texture or null if not found.

References pRotation.

Referenced by writeToFile().

◆ loadAndAddElement()

void Dragengine.Preloading.StubElement.loadAndAddElement ( PersistencyEnvironment env,
FileReader reader,
GameWorld gameWorld )

Load element using file reader and add it to game world.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

References getConnection(), pConnection, and setAttachTo().

Referenced by writeToFile().

◆ loadElement()

Element Dragengine.Preloading.StubElement.loadElement ( PersistencyEnvironment env,
FileReader reader )

Load element using file reader.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

Referenced by writeToFile().

◆ new() [1/4]

◆ new() [2/4]

StubElement Dragengine.Preloading.StubElement.new ( ElementClass eclass,
UniqueID id )

Create element stub.

References new().

◆ new() [3/4]

StubElement Dragengine.Preloading.StubElement.new ( ElementClass eclass,
UniqueID id,
StubWithProperties properties )

Create element stub.

References new().

◆ new() [4/4]

StubElement Dragengine.Preloading.StubElement.new ( StubElement stub)

Create copy of element stub.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

References new(), pClass, pPosition, and pRotation.

◆ preloadResources()

void Dragengine.Preloading.StubElement.preloadResources ( )

Preload resources.

References pID.

Referenced by writeToFile().

◆ readFromFile()

StubElement Dragengine.Preloading.StubElement.readFromFile ( FileReader reader,
ElementClassList elementClassList )
static

Read stub from file.

If the element class is not found an instance of StubElementClassNotFound is returned.

Returns
stub element or null if classname is empty. This is used to find the end of stub list since the total number of elements is often not known.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

References pConnection, and setConnection().

Referenced by writeToFile().

◆ removeAllAttachableBehaviors()

void Dragengine.Preloading.StubElement.removeAllAttachableBehaviors ( )

Remove all attachable behaviors.

Version
1.29

References getID(), pID, and pMatrix.

Referenced by writeToFile().

◆ removeAllTextures()

void Dragengine.Preloading.StubElement.removeAllTextures ( )

Remove all textures.

Version
1.23

References new(), and setScaling().

Referenced by writeToFile().

◆ removeAttachableBehavior()

void Dragengine.Preloading.StubElement.removeAttachableBehavior ( String factoryId)

Remove attachable behavior.

Version
1.29

References getMatrix(), and pMatrix.

Referenced by writeToFile().

◆ removeTexture()

void Dragengine.Preloading.StubElement.removeTexture ( StubElementTexture texture)

Remove texture.

Version
1.23

References getScaling(), and pMatrix.

Referenced by writeToFile().

◆ setAttachTo()

void Dragengine.Preloading.StubElement.setAttachTo ( UniqueID id)

Set dentifier of object to attach to once added to a game world.

References pClass.

Referenced by loadAndAddElement().

◆ setClass()

void Dragengine.Preloading.StubElement.setClass ( ElementClass elementClass)

Set element class.

References new(), pID, and pTextures.

Referenced by setConnection().

◆ setConnection()

void Dragengine.Preloading.StubElement.setConnection ( Connection connection)

Set connection to server or null.

References new(), and setClass().

Referenced by readFromFile().

◆ setEnableNetworking()

void Dragengine.Preloading.StubElement.setEnableNetworking ( bool enable)

Set if networking is enabled for this stub.

References new(), and setPosition().

Referenced by writeToFile().

◆ setID()

void Dragengine.Preloading.StubElement.setID ( UniqueID id)

Set unique identifier of object.

References pCounter.

Referenced by forEachAttachableBehavior().

◆ setNetworkState()

void Dragengine.Preloading.StubElement.setNetworkState ( NetworkState networkState)

Set network state provided by server or null.

References getPosition().

Referenced by writeToFile().

◆ setPosition()

void Dragengine.Preloading.StubElement.setPosition ( DVector position)

Set position.

References new().

Referenced by setEnableNetworking().

◆ setRotation()

void Dragengine.Preloading.StubElement.setRotation ( Vector rotation)

Set rotation.

References new(), and pClass.

Referenced by forEachTexture().

◆ setScaling()

void Dragengine.Preloading.StubElement.setScaling ( Vector scaling)

Set scaling if sizable.

References pEnableNetworking, pID, and pTextures.

Referenced by removeAllTextures().

◆ writeToFile()

Member Data Documentation

◆ pAddAttachableBehaviors

Array Dragengine.Preloading.StubElement.pAddAttachableBehaviors

Referenced by getMatrix(), getPosition(), and writeToFile().

◆ pClass

ElementClass Dragengine.Preloading.StubElement.pClass

◆ pConnection

Connection Dragengine.Preloading.StubElement.pConnection

Referenced by loadAndAddElement(), and readFromFile().

◆ pCounter

PreloadCounter Dragengine.Preloading.StubElement.pCounter

Referenced by setID().

◆ pEnableNetworking

bool Dragengine.Preloading.StubElement.pEnableNetworking

◆ pID

UniqueID Dragengine.Preloading.StubElement.pID

◆ pMatrix

◆ pNetworkState

NetworkState Dragengine.Preloading.StubElement.pNetworkState

Referenced by writeToFile().

◆ pPosition

DVector Dragengine.Preloading.StubElement.pPosition

◆ pRotation

Vector Dragengine.Preloading.StubElement.pRotation

◆ pTextures

Array Dragengine.Preloading.StubElement.pTextures

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