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

Static Public Member Functions

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

Public Attributes

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

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

◆ createAndAddElement()

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

Create element and add it to game world.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

◆ forEachTexture()

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

Visit textures with a block.

◆ getAttachTo()

UniqueID Dragengine.Preloading.StubElement.getAttachTo ( )

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

◆ getConnection()

Connection Dragengine.Preloading.StubElement.getConnection ( )

Connection to server or or null.

◆ getEnableNetworking()

bool Dragengine.Preloading.StubElement.getEnableNetworking ( )

Enable networking for this stub.

◆ getID()

UniqueID Dragengine.Preloading.StubElement.getID ( )

Unique identifier of object.

◆ getMatrix()

DMatrix Dragengine.Preloading.StubElement.getMatrix ( )

Stub matrix.

Version
1.23

◆ getNetworkState()

NetworkState Dragengine.Preloading.StubElement.getNetworkState ( )

Network state provided by server or null.

◆ getPosition()

DVector Dragengine.Preloading.StubElement.getPosition ( )

Position.

◆ getRotation()

Vector Dragengine.Preloading.StubElement.getRotation ( )

Rotation.

◆ getScaling()

Vector Dragengine.Preloading.StubElement.getScaling ( )

Scaling if sizable.

◆ getTextureAt()

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

Texture at index.

◆ getTextureCount()

int Dragengine.Preloading.StubElement.getTextureCount ( )

Number of textures.

◆ getTextureNamed()

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

Named texture or null if not found.

◆ 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.

◆ loadElement()

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

Load element using file reader.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

◆ new() [1/4]

StubElement Dragengine.Preloading.StubElement.new ( ElementClass  eclass)

Create element stub.

◆ new() [2/4]

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

Create element stub.

◆ new() [3/4]

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

Create element stub.

◆ new() [4/4]

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

Create copy of element stub.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

◆ preloadResources()

void Dragengine.Preloading.StubElement.preloadResources ( )

Preload resources.

◆ readFromFile()

static 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.

◆ removeAllTextures()

void Dragengine.Preloading.StubElement.removeAllTextures ( )

Remove all textures.

Version
1.23

◆ removeTexture()

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

Remove texture.

Version
1.23

◆ setAttachTo()

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

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

◆ setClass()

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

Set element class.

◆ setConnection()

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

Set connection to server or null.

◆ setEnableNetworking()

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

Set if networking is enabled for this stub.

◆ setID()

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

Set unique identifier of object.

◆ setNetworkState()

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

Set network state provided by server or null.

◆ setPosition()

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

Set position.

◆ setRotation()

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

Set rotation.

◆ setScaling()

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

Set scaling if sizable.

◆ writeToFile()

void Dragengine.Preloading.StubElement.writeToFile ( FileWriter  writer)

Write stub to file.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

Member Data Documentation

◆ pAttachTo

UniqueID Dragengine.Preloading.StubElement.pAttachTo

◆ pClass

ElementClass Dragengine.Preloading.StubElement.pClass

◆ pConnection

Connection Dragengine.Preloading.StubElement.pConnection

◆ pCounter

PreloadCounter Dragengine.Preloading.StubElement.pCounter

◆ pEnableNetworking

bool Dragengine.Preloading.StubElement.pEnableNetworking

◆ pID

UniqueID Dragengine.Preloading.StubElement.pID

◆ pMatrix

DMatrix Dragengine.Preloading.StubElement.pMatrix

◆ pNetworkState

NetworkState Dragengine.Preloading.StubElement.pNetworkState

◆ pPosition

DVector Dragengine.Preloading.StubElement.pPosition

◆ pRotation

Vector Dragengine.Preloading.StubElement.pRotation

◆ pScaling

Vector Dragengine.Preloading.StubElement.pScaling

◆ pTextures

Array Dragengine.Preloading.StubElement.pTextures

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