Methods
addAfter (_roomName:String):RoomNode
Adds a room after _roomName
Parameters:
_roomName | name of the room to add this after |
---|
Returns:
this
addBefore (_roomName:String):RoomNode
Adds a room before _roomName
Parameters:
_roomName | name of the room to add this before |
---|
Returns:
this
addBetween (_firstRoomName:String, _secondRoomName:String, _minSpawnDistance:Int):RoomNode
Adds a room between between two rooms passed as parameter with a minimum Distance of _minSpawnDistance
Parameters:
_firstRoomName | starting room name |
---|---|
_secondRoomName | ending room name |
_minSpawnDistance | minimum distance between rooms to respect. |
Returns:
this
addBetweenMultipleEnds (_firstRoomName:String, _secondRoomNames:Array<String>, _minSpawnDistance:Int):RoomNode
Adds a room between between _firstRoom and one of the second rooms randomly picked with a minimum Distance of _minSpawnDistance
Parameters:
_firstRoomName | starting room name |
---|---|
_secondRoomNames | list of ending room name to pick from |
_minSpawnDistance | minimum distance between rooms to respect. |
Returns:
this
addChild (_room:RoomNode):RoomNode
Adds the room passed as a child of this room, return
Parameters:
_child | room to add as a child |
---|
Returns:
this
addFlag (_flag:RoomFlag):RoomNode
Adds a RoomFlag on the room
Parameters:
_flag | RoomFlag to add. Can be : LockedNeedKey; LockedNeedCard; TemplateFlip; Outside; InsideOut; // Inside room in the main branch of an outside level |
---|
Returns:
this
addZChild (_node:RoomNode):RoomNode
Adds a room that can be accessed via a Z door
Parameters:
_node | Room representing the room entered when the Z door is used |
---|
Returns:
this
addZChildWithClue (_node:RoomNode, _clue:ZDoorContentClue):RoomNode
Adds a room that can be accessed via a Z door with a clue of what's inside on it
Parameters:
_room | Room representing the first entered when the Z door is used |
---|---|
_clue | clue to be displayed on the door |
Returns:
this
addZLink (_roomName:String):RoomNode
Allows to link a z exit passed as argument to main level
Parameters:
_roomName | name of the room to link to the main level |
---|
Returns:
this
branchBetween (_start:String, _end:String, _minSpawnDistance:Null<Int>):RoomNode
Creates a crossing in the level structure and adds it between _start and _end
Parameters:
_start | name of the room to add the crossing after |
---|---|
_end | name of the room to add the crossing before |
_minSpawnDistance | minimum distance between rooms to respect. |
Returns:
this
branchBetweenMultipleEnds (_start:String, _ends:Array<String>, _minSpawnDistance:Int):RoomNode
Creates a crossing in the level structure and adds it between _start and one of the value in _ends picked randomly
Parameters:
_start | name of the room to add the crossing after |
---|---|
_ends | list of ending room name to pick from |
_minSpawnDistance | minimum distance between rooms to respect. |
Returns:
this
branchOrAddBetween (_start:String, _ends:Array<String>, _minSpawnDistance:Int):RoomNode
Pick a random number between 0 and 3, if it's 0, does a branchBetween else a addBetween
Parameters:
_start | starting room name |
---|---|
_ends | list of ending room name to pick from |
_minSpawnDistance | minimum distance between rooms to respect. |
Returns:
this
calcDistanceToCondition (_conditionFunction:RoomNode ‑> Bool, _checkThis:Bool):Int
Calculate the distance between this and first room corresponding to the condition passed as a parameter
Parameters:
_conditionFunction | function returning true if it correspond to the condition you're looking for |
---|---|
_checkThis | specify if it should check this as well |
Returns:
the distance between this and the result room
calcTypeDistance (_typeName:String, _checkThis:Bool):Int
Gives the distance between this and another room of type _typeName
Parameters:
_typeName | Type of the room to look for |
---|---|
_checkThis | Specifies if this should be considered as a match |
Returns:
the number of rooms between this an closest room of type _typeName. Returns 999 if none is found
chain (_node:RoomNode):RoomNode
Adds the room passed as a parameter after this room
Parameters:
_node | RoomNode to chain tho this |
---|
Returns:
the node _node passed as a parameter
countChildren (_conditionFunction:RoomNode ‑> Bool):Int
Returns the number of children (recursively) that respect the condition passed as a parameter
Parameters:
_conditionFunction | function returning if the child respect condition to be counted and if recursion should go on |
---|
Returns:
the number of children (recursively) for which the _conditionFunction returned true
forceBiome (_biomeName:String):RoomNode
Force the sub biome of the room and all its children.
Parameters:
_biomeName | biome's name to force |
---|
Returns:
this
getChild (_index:Int):Null<RoomNode>
Returns indexTh child of this
Parameters:
_index | index of the child to get (will throw an exception if _index > childrenCount) |
---|
Returns:
the roomNode corresponding to the index passed
hasFlag (_flag:RoomFlag):Bool
Specifies if the room has the specific flag
Parameters:
_flag | RoomFlag to look for. Can be : LockedNeedKey; LockedNeedCard; TemplateFlip; Outside; InsideOut; // Inside room in the main branch of an outside level |
---|
Returns:
true if the flag is present, false otherwise
hasParentMetaGate (_includeSelf:Bool):Bool
Specifies if on of the room parent is a room which needs a meta rune to cross it
Parameters:
_includeSelf | specifies if the function should check this room too |
---|
Returns:
true if one of the parent needs a meta rune to cross it, false otherwise
hasParentType (_type:String):Bool
Specifies if this room as a parent with the type passed as paramater
Parameters:
_type | type to check for |
---|
Returns:
true if one of this room's parent's type is the same as the one passed as parameter, false otherwise
isChildOf (_node:RoomNode):Bool
Specifies if this room is on the same path as _node and comes after it
Parameters:
_node | node to check |
---|
Returns:
true if the room is on the same path as _node and after it, false in any other case
isMainLevel ():Bool
Specifies if the room is accessed via a Z Door or not
Returns:
true when the room is on the main path, false when the room is accessed via a Z door
isMetaGate ():Bool
Specifies if the room needs a meta rune to be crossed
Returns:
true when the room needs a meta rune to be crossed, false otherwise
isParentOf (_node:RoomNode):Bool
Specifies if this room is on the same path as _node and comes before it
Parameters:
_node | node to check |
---|
Returns:
true if the room is on the same path as _node and before it, false in any other case
isSpecificRoom (_roomName:String):Bool
Specifies if this is using a specific room
Parameters:
_roomName | : name of the room to look for |
---|
Returns:
true if this is using the room passed as a parameter
searchParent (_conditionFunction:RoomNode ‑> Bool):Null<RoomNode>
Return first parent that correspond to the condition passed as a parameter
Parameters:
_conditionFunction | function returning true if it correspond to the condition you're looking for |
---|
Returns:
the first parent corresponding to the condition passed. null if none are found
setChildPriority (_priority:Int):Void
Sets the priority of a room child in the sequence of children
Parameters:
_priority | arbitrary priority |
---|
setConstraint (_constraint:LinkConstraint):RoomNode
Sets a constraint on a room.
Parameters:
_constraint | constraint to place. Can be : All; HorizontalOnly; HorizontalSameDirOnly; VerticalOnly; UpOnly; DownOnly; |
---|
Returns:
this
setGroup (_groupName:String):Void
Sets the group of the room.
Parameters:
_groupName | one of the separator names in room table in data.cdb |
---|
setItemInWall (_itemName:String):RoomNode
Force the item passed as parameter to be hidden in a wall of the room
Parameters:
_itemName | item to hide in one of the walls. Valid values are in the id column of the item table in the CDB |
---|
Returns:
this
setName (_roomName:String):RoomNode
Sets the unique name for the room
Parameters:
_roomName | base name to set, will be suffixed by a number if the base name already exists |
---|
Returns:
this
setSubTeleport (_targetRoom:RoomNode):RoomNode
Set the room target destination for a room containing a subteleport (will be ignore if set on a room that is not a subteleport)
Parameters:
_targetRoom | room where the subteleport should teleport the player |
---|
Returns:
this
setType (_typeName:String):Void
Sets the type of the room. Type of the room should be one of the values present in id column in table roomType in data.cdb
Parameters:
_typeName | one of the value present in id column in roomType table in data.cdb |
---|