Drag[en]gine Script Module DragonScript  1.21
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 addTexture (StubElementTexture texture)
 Add texture. More...
 
void createAndAddElement (GameWorld gameWorld)
 Create element and add it to game world. More...
 
Element createElement ()
 Create element. 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...
 
ElementClass getClass ()
 Element class. 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...
 
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...
 
void loadResources ()
 Load resources. 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 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 setCounter (PreloadCounter counter)
 Set counter. 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...
 
bool verifyPreloading (Console console)
 Verify if a resource failed preloading and print the problems to the console. More...
 
void writeToFile (FileWriter writer)
 Write stub to file. More...
 
- Public Member Functions inherited from Dragengine.Preloading.StubWithProperties
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 (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...
 

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

◆ addTexture()

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

Add texture.

◆ createAndAddElement()

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

Create element and add it to game world.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

◆ createElement()

Element Dragengine.Preloading.StubElement.createElement ( )

Create element.

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.

◆ getClass()

ElementClass Dragengine.Preloading.StubElement.getClass ( )

Element class.

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

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

◆ loadResources()

void Dragengine.Preloading.StubElement.loadResources ( )

Load resources.

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

◆ readFromFile()

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

Read stub from file.

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.

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

◆ setCounter()

void Dragengine.Preloading.StubElement.setCounter ( PreloadCounter  counter)

Set counter.

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

◆ verifyPreloading()

bool Dragengine.Preloading.StubElement.verifyPreloading ( Console  console)

Verify if a resource failed preloading and print the problems to the console.

Returns
true if all resources loaded successfully.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.

◆ writeToFile()

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

Write stub to file.

Reimplemented in Dragengine.Preloading.StubElementClassNotFound.


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