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

Stub for constructing game world. More...

Inheritance diagram for Dragengine.Preloading.StubGameWorld:
Dragengine.Preloading.StubWithProperties

Public Member Functions

void addElement (StubElement element)
 Add element stub.
void addElementClassesTo (PreloadManager preloadManager)
 Add all element classes to the preload manager.
void addNavigationSpace (NavigationSpace navspace)
 Add navigation space.
void addWorldDecal (StubWorldDecal worldDecal)
 Add world decal stub.
void beginPreloading ()
 Begin preloading resources.
void createAndAddElements (Console console)
 Create and add all elements.
void forEachElement (Block ablock)
 Visit element stubs using block with StubElement as parameter.
void forEachWorldDecal (Block ablock)
 Visit world decal stubs using block with StubWorldDecal as parameter.
StubElement getElementAt (int index)
 Element stub at index.
NavigationSpace getNavigationSpaceAt (int index)
 Navigation space at index.
int getNavigationSpaceCount ()
 Number of navigation spaces.
StubWorldDecal getWorldDecalAt (int index)
 World decal stub at index.
void loadResources ()
 Loading resources.
StubGameWorld new (GameWorld gameWorld, PreloadCounter parentCounter)
 Create stub.
StubGameWorld new (StubGameWorld stub)
 Create copy of stub.
void preloadElementResources ()
 Preload element resources.
void preloadWorldDecalResources ()
 Preload world decal resources.
void remapObjectIDs (UniqueIDRemapper remapper)
 Remap object IDs.
void removeAllElements ()
 Remove all elements.
void removeAllNavigationSpaces ()
 Remove all navigation spaces.
void setNewElementsRange (UniqueIDRemapper.RemapEntry range)
 Set range of new elements added since the last saving or null.
void setNextObjectID (UniqueID nextObjectID)
 Set next object ID.
bool updatePreloading ()
 Update preloading.
bool verifyPreloading (Console console)
 Verify if resources failed preloading printing problems to console.
void worldAddNavigationSpaces ()
 Add navigation spaces to world.
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.

Public Attributes

PreloadCounter pCounter
Array pElements
GameWorld pGameWorld
Array pNavSpaces
UniqueIDRemapper.RemapEntry pNewElementsRange
UniqueID pNextObjectID
Array pWorldDecals
Public Attributes inherited from Dragengine.Preloading.StubWithProperties
Dictionary pProperties
 Properties.

Protected Member Functions

void loadAndAddPersistableElementsOld (Console console, PersistencyEnvironment env, FileReader reader)

Detailed Description

Stub for constructing game world.

Supports preloading resources in the background as well as game world creation.

Member Function Documentation

◆ addElement()

void Dragengine.Preloading.StubGameWorld.addElement ( StubElement element)

Add element stub.

Referenced by loadResources().

◆ addElementClassesTo()

void Dragengine.Preloading.StubGameWorld.addElementClassesTo ( PreloadManager preloadManager)

Add all element classes to the preload manager.

References pWorldDecals.

Referenced by loadResources().

◆ addNavigationSpace()

void Dragengine.Preloading.StubGameWorld.addNavigationSpace ( NavigationSpace navspace)

Add navigation space.

Referenced by loadResources().

◆ addWorldDecal()

void Dragengine.Preloading.StubGameWorld.addWorldDecal ( StubWorldDecal worldDecal)

Add world decal stub.

References new(), and pCounter.

Referenced by preloadElementResources().

◆ beginPreloading()

void Dragengine.Preloading.StubGameWorld.beginPreloading ( )

Begin preloading resources.

Referenced by loadResources().

◆ createAndAddElements()

void Dragengine.Preloading.StubGameWorld.createAndAddElements ( Console console)

Create and add all elements.

Call for newly create game worlds. For loading game worlds use:

  • createAndAddNonPersistableElements()
  • createAndAddPersistableElements()
  • loadAndAddPersistableElements()

References getWorldDecalAt(), and pWorldDecals.

Referenced by loadResources().

◆ forEachElement()

void Dragengine.Preloading.StubGameWorld.forEachElement ( Block ablock)

Visit element stubs using block with StubElement as parameter.

References pGameWorld.

Referenced by loadResources().

◆ forEachWorldDecal()

void Dragengine.Preloading.StubGameWorld.forEachWorldDecal ( Block ablock)

Visit world decal stubs using block with StubWorldDecal as parameter.

Referenced by getNavigationSpaceAt().

◆ getElementAt()

StubElement Dragengine.Preloading.StubGameWorld.getElementAt ( int index)

Element stub at index.

References pElements.

Referenced by verifyPreloading().

◆ getNavigationSpaceAt()

NavigationSpace Dragengine.Preloading.StubGameWorld.getNavigationSpaceAt ( int index)

Navigation space at index.

References forEachWorldDecal(), and pWorldDecals.

Referenced by loadResources().

◆ getNavigationSpaceCount()

int Dragengine.Preloading.StubGameWorld.getNavigationSpaceCount ( )

Number of navigation spaces.

Referenced by loadResources().

◆ getWorldDecalAt()

StubWorldDecal Dragengine.Preloading.StubGameWorld.getWorldDecalAt ( int index)

World decal stub at index.

References new(), pElements, pNavSpaces, and pWorldDecals.

Referenced by createAndAddElements().

◆ loadAndAddPersistableElementsOld()

void Dragengine.Preloading.StubGameWorld.loadAndAddPersistableElementsOld ( Console console,
PersistencyEnvironment env,
FileReader reader )
protected

Referenced by loadResources().

◆ loadResources()

◆ new() [1/2]

StubGameWorld Dragengine.Preloading.StubGameWorld.new ( GameWorld gameWorld,
PreloadCounter parentCounter )

◆ new() [2/2]

StubGameWorld Dragengine.Preloading.StubGameWorld.new ( StubGameWorld stub)

Create copy of stub.

◆ preloadElementResources()

void Dragengine.Preloading.StubGameWorld.preloadElementResources ( )

Preload element resources.

References addWorldDecal(), new(), and pWorldDecals.

Referenced by loadResources().

◆ preloadWorldDecalResources()

void Dragengine.Preloading.StubGameWorld.preloadWorldDecalResources ( )

Preload world decal resources.

References new(), and pWorldDecals.

Referenced by loadResources(), and removeAllNavigationSpaces().

◆ remapObjectIDs()

void Dragengine.Preloading.StubGameWorld.remapObjectIDs ( UniqueIDRemapper remapper)

Remap object IDs.

Referenced by loadResources().

◆ removeAllElements()

void Dragengine.Preloading.StubGameWorld.removeAllElements ( )

Remove all elements.

Referenced by loadResources().

◆ removeAllNavigationSpaces()

void Dragengine.Preloading.StubGameWorld.removeAllNavigationSpaces ( )

Remove all navigation spaces.

References preloadWorldDecalResources(), and pWorldDecals.

Referenced by loadResources().

◆ setNewElementsRange()

void Dragengine.Preloading.StubGameWorld.setNewElementsRange ( UniqueIDRemapper.RemapEntry range)

Set range of new elements added since the last saving or null.

References pWorldDecals.

Referenced by loadResources().

◆ setNextObjectID()

void Dragengine.Preloading.StubGameWorld.setNextObjectID ( UniqueID nextObjectID)

Set next object ID.

References pWorldDecals.

Referenced by loadResources().

◆ updatePreloading()

bool Dragengine.Preloading.StubGameWorld.updatePreloading ( )

Update preloading.

Returns false if the preloading has not yet finished. If all resources are loaded the game world and the individual elements are updated and the required engine objects created. Once all this has been done true is returned.

References pElements.

Referenced by loadResources().

◆ verifyPreloading()

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

Verify if resources failed preloading printing problems to console.

Returns
true if all resources loaded successfully or false otherwise.

References getElementAt(), and pElements.

Referenced by loadResources().

◆ worldAddNavigationSpaces()

void Dragengine.Preloading.StubGameWorld.worldAddNavigationSpaces ( )

Add navigation spaces to world.

Referenced by loadResources().

Member Data Documentation

◆ pCounter

PreloadCounter Dragengine.Preloading.StubGameWorld.pCounter

Referenced by addWorldDecal(), and loadResources().

◆ pElements

Array Dragengine.Preloading.StubGameWorld.pElements

◆ pGameWorld

GameWorld Dragengine.Preloading.StubGameWorld.pGameWorld

Referenced by forEachElement(), loadResources(), and new().

◆ pNavSpaces

Array Dragengine.Preloading.StubGameWorld.pNavSpaces

Referenced by getWorldDecalAt(), and loadResources().

◆ pNewElementsRange

UniqueIDRemapper.RemapEntry Dragengine.Preloading.StubGameWorld.pNewElementsRange

Referenced by loadResources().

◆ pNextObjectID

UniqueID Dragengine.Preloading.StubGameWorld.pNextObjectID

Referenced by loadResources().

◆ pWorldDecals


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