Drag[en]gine Script Module DragonScript Script API  1.0
ElementClass Class Reference
Inheritance diagram for ElementClass:
ResourceNotifier LightPointClass LightSpotClass SimpleElementClass SpawnPointClass TriggerAreaClass TriggerCounterClass TriggerShoutClass

Public Member Functions

void addDependencies (PreloadManager preloadManager)
void addProperty (ElementClassProperty property)
 Add property. More...
void createAndAddElement (StubElement stub, GameWorld gameWorld)
Element createElement (StubElement stub)
void dispose ()
ElementClass duplicateNamed (String classname)
bool equals (Object obj)
void failedLoading (String path, int resourceType)
void finishedLoading (String path, int resourceType, Object resource)
void forEachProperty (Block ablock)
 Visit properties with block with parameter ElementClass. More...
String getClassname ()
bool getLoadIfNetGameClient ()
int getPropertyCount ()
 Number of properties. More...
ElementClassProperty getPropertyNamed (String name)
 Named property or null if absent. More...
Array getPropertyNames ()
 List of property names as array of strings. More...
int hashCode ()
bool hasPropertyNamed (String name)
 Named property is present. More...
void loadAndAddElement (FileReader reader, GameWorld gameWorld)
Element loadElement (FileReader reader)
ElementClass new (String className)
void preloadResources ()
void setLoadIfNetGameClient (bool loadIfNetGameClient)

Detailed Description

Describes a class of elements. Instances of this element classes can be used to build elements. Also provided is a list of properties of elements belonging to this element class.

Roland Pl├╝ss

Member Function Documentation

§ addDependencies()

void addDependencies ( PreloadManager  preloadManager)

Adds element classes this class depends on. Dependent classes usually are elements created alongside elements of this class or elements which can be produced during the lifetime of an element of this class.

§ addProperty()

void addProperty ( ElementClassProperty  property)

Add property.

§ createAndAddElement()

void createAndAddElement ( StubElement  stub,
GameWorld  gameWorld 

Creates an element from the given stub and adds it to a game world. Not all classes really create an element hence this call allows to also create other resources added to a game world in a specific way. The default implementation creates an element using createElement and adds it to the game world using addElement if not null.

§ createElement()

Element createElement ( StubElement  stub)

Creates an element from the given stub and returns it. If this class does not support creating elements ( because for example since the result is not an element ) null is returned.

§ dispose()

void dispose ( )

Dispose of this element class.

§ duplicateNamed()

ElementClass duplicateNamed ( String  classname)

Creates a new element class with the given name based on this class. This is used for creating element classes using XML definitions instead of coding. If this class does not support creation of sub classes using XML definition null has to be returned. The default implementation returns null.

§ equals()

bool equals ( Object  obj)

Determines if this element class is equal to some other object. Two element classes are equal if they have the same class name.

objObject to compare to
True if both ElementFactory objects have the same classname

§ failedLoading()

void failedLoading ( String  path,
int  resourceType 

Resource failed loading.

Implements ResourceNotifier.

§ finishedLoading()

void finishedLoading ( String  path,
int  resourceType,
Object  resource 

Resource finished loading successfully.

Implements ResourceNotifier.

§ forEachProperty()

void forEachProperty ( Block  ablock)

Visit properties with block with parameter ElementClass.

§ getClassname()

String getClassname ( )

Retrieves the unique class name.

§ getLoadIfNetGameClient()

bool getLoadIfNetGameClient ( )

Determines if this class is loaded if a network game client.

§ getPropertyCount()

int getPropertyCount ( )

Number of properties.

§ getPropertyNamed()

ElementClassProperty getPropertyNamed ( String  name)

Named property or null if absent.

§ getPropertyNames()

Array getPropertyNames ( )

List of property names as array of strings.

§ hashCode()

int hashCode ( )

Retrieves the hash code of the element class. This is the hashcode of the class name.

hash code of

§ hasPropertyNamed()

bool hasPropertyNamed ( String  name)

Named property is present.

§ loadAndAddElement()

void loadAndAddElement ( FileReader  reader,
GameWorld  gameWorld 

Loads an element using a file reader and adds it to the game world.

§ loadElement()

Element loadElement ( FileReader  reader)

Loads an element using a file reader and returns it. If this class does not support loading elements (because for example the result is not an element) null has to be returned.

§ new()

ElementClass new ( String  className)

Creates a new ElementClass object.

§ preloadResources()

void preloadResources ( )

Preload resources.

§ setLoadIfNetGameClient()

void setLoadIfNetGameClient ( bool  loadIfNetGameClient)

Sets if this class is loaded as a network game client.

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