Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.Rail Class Reference

Rail defining path for elements. More...

Inheritance diagram for Dragengine.Scenery.Rail:

Public Member Functions

void addCorner (RailCorner corner)
 Add corner. More...
 
void dispose ()
 Dispose of rail. More...
 
RailCorner getCornerAt (int index)
 Corner at index. More...
 
int getCornerCount ()
 Number of corners. More...
 
RailCorner getCornerWithOrder (int order)
 Corner with corner or null if absent. More...
 
RailCorner getFirstCorner ()
 Get corner at beginning of rail or null if rail is empty. More...
 
StringID getID ()
 Identifier. More...
 
RailCorner getLastCorner ()
 Get corner at end of rail or null if rail is empty. More...
 
bool hasCorners ()
 Rail has corners. More...
 
Rail new (StringID id)
 Create rail. More...
 

Detailed Description

Rail defining path for elements.

Contains corner points defining the path for elements or other objects requiring a path placed down by a level artist in the game world. Each corner has a position, orientation and an order number. The order number is used to sort the corners along the rail path. The rail is non-forking running from the corner with the lowest order to the corner with the highest order. Adding corners inserts them sorted by their order.

Rails have a unique identifier. This identifier is used by elements to locate the path in RailList of the GameWorld they are located in. If not found RailList.getWithID() returns null. To define rails use RailList.getOrAddWithID(). This method creates the rail if not found and thus always returns a Rail instance. This is required because the loading order of elements in a GameWorld is not well defined.

While the Rail class is usually not subclasses the RailCorner is created by rail corner element classes and can be subclassed to add additional properties to corners.

Member Function Documentation

◆ addCorner()

void Dragengine.Scenery.Rail.addCorner ( RailCorner  corner)

Add corner.

Exceptions
EInvalidParamCorner with same order is present.

◆ dispose()

void Dragengine.Scenery.Rail.dispose ( )

Dispose of rail.

◆ getCornerAt()

RailCorner Dragengine.Scenery.Rail.getCornerAt ( int  index)

Corner at index.

◆ getCornerCount()

int Dragengine.Scenery.Rail.getCornerCount ( )

Number of corners.

◆ getCornerWithOrder()

RailCorner Dragengine.Scenery.Rail.getCornerWithOrder ( int  order)

Corner with corner or null if absent.

◆ getFirstCorner()

RailCorner Dragengine.Scenery.Rail.getFirstCorner ( )

Get corner at beginning of rail or null if rail is empty.

◆ getID()

StringID Dragengine.Scenery.Rail.getID ( )

Identifier.

◆ getLastCorner()

RailCorner Dragengine.Scenery.Rail.getLastCorner ( )

Get corner at end of rail or null if rail is empty.

◆ hasCorners()

bool Dragengine.Scenery.Rail.hasCorners ( )

Rail has corners.

◆ new()

Rail Dragengine.Scenery.Rail.new ( StringID  id)

Create rail.


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