Drag[en]gine Script Module DragonScript Script API  1.0
StubElement Class Reference

Stub for an element. More...

Inheritance diagram for StubElement:
StubWithProperties

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...
 
ElementClass getClass ()
 Element class. More...
 
UniqueID getID ()
 Identifier used to uniquely identify elements in save states and across networks. 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...
 
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 setCounter (PreloadCounter counter)
 Set counter. More...
 
void setElementClass (ElementClass elementClass)
 Set element class. More...
 
void setID (UniqueID id)
 Set identifier used to uniquely identify elements in save states and across networks. 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 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 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.

Member Function Documentation

◆ addTexture()

void addTexture ( StubElementTexture  texture)

Add texture.

◆ createAndAddElement()

void createAndAddElement ( GameWorld  gameWorld)

Create element and add it to game world.

◆ createElement()

Element createElement ( )

Create element.

◆ forEachTexture()

void forEachTexture ( Block  ablock)

Visit textures with a block.

◆ getClass()

ElementClass getClass ( )

Element class.

◆ getID()

UniqueID getID ( )

Identifier used to uniquely identify elements in save states and across networks.

◆ getPosition()

DVector getPosition ( )

Position.

◆ getRotation()

Vector getRotation ( )

Rotation.

◆ getScaling()

Vector getScaling ( )

Scaling if sizable.

◆ getTextureAt()

StubElementTexture getTextureAt ( int  index)

Texture at index.

◆ getTextureCount()

int getTextureCount ( )

Number of textures.

◆ loadAndAddElement()

void loadAndAddElement ( PersistencyEnvironment  env,
FileReader  reader,
GameWorld  gameWorld 
)

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

◆ loadElement()

Element loadElement ( PersistencyEnvironment  env,
FileReader  reader 
)

Load element using file reader.

◆ loadResources()

void loadResources ( )

Load resources.

◆ new() [1/4]

StubElement new ( ElementClass  eclass)

Create element stub.

◆ new() [2/4]

StubElement new ( ElementClass  eclass,
UniqueID  id 
)

Create element stub.

◆ new() [3/4]

StubElement new ( ElementClass  eclass,
UniqueID  id,
StubWithProperties  properties 
)

Create element stub.

◆ new() [4/4]

StubElement new ( StubElement  stub)

Create copy of element stub.

◆ readFromFile()

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

◆ setCounter()

void setCounter ( PreloadCounter  counter)

Set counter.

◆ setElementClass()

void setElementClass ( ElementClass  elementClass)

Set element class.

◆ setID()

void setID ( UniqueID  id)

Set identifier used to uniquely identify elements in save states and across networks.

◆ setPosition()

void setPosition ( DVector  position)

Set position.

◆ setRotation()

void setRotation ( Vector  rotation)

Set rotation.

◆ setScaling()

void setScaling ( Vector  scaling)

Set scaling if sizable.

◆ verifyPreloading()

bool verifyPreloading ( Console  console)

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

Returns
true if all resources loaded successfully.

◆ writeToFile()

void writeToFile ( FileWriter  writer)

Write stub to file.


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