Jumpvalley 0.5.0
An app and library that can be used to test and run 3D platformer levels. Currently being made with Godot.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Jumpvalley.Levels.Interactives.InteractiveNode Class Reference

A subclass of Interactive that operates over a Godot node. It makes using a Godot node's properties and metadata easier. See the relevant wiki sectionfor details. More...

Inheritance diagram for Jumpvalley.Levels.Interactives.InteractiveNode:
Jumpvalley.Levels.Interactives.Interactive Jumpvalley.Levels.Interactives.Mechanics.CheckpointSet Jumpvalley.Levels.Interactives.Mechanics.OverallBoundingBoxObject Jumpvalley.Levels.Interactives.Mechanics.Spinner Jumpvalley.Levels.Interactives.Mechanics.Teleporters.Teleporter Jumpvalley.Levels.Interactives.Mechanics.Teleporters.StartEndTeleporter

Public Member Functions

 InteractiveNode (OffsetStopwatch stopwatch, Node nodeMarker)
 Creates a new instance of InteractiveNode for a given Stopwatch and Node
 
bool TryGetMarkerMeta (string name, out Variant meta)
 Attempts to get the value of a metadata entry with a specified name if it exists and assigns it to the meta reference variable.
 
bool TryGetMarkerMeta<[MustBeVariant] T > (string name, out T meta)
 Version of TryGetMeta(string, out Variant) that outputs the metadata entry value as a specified type T .
 
void SetMarkerMeta (string name, Variant value)
 Sets the metadata entry belonging to NodeMarker with the given name to the specified value.
 
- Public Member Functions inherited from Jumpvalley.Levels.Interactives.Interactive
 Interactive (OffsetStopwatch clock, object runner=null)
 Creates a new instance of Interactive that will run on the given OffsetStopwatch.
 
virtual void Initialize ()
 Interactive initialization method that initializes the interactive after the constructor runs, in case such method is needed.
By default, this method is only called once after the object's constructor runs. Initialize() typically shouldn't be called more than once for the same Interactive instance.
 
virtual void Start ()
 The interactive's start method. This method is called every time the user starts or restarts the interactive, and it's a great place to put code that will be run after initialization, but just before the interactive starts.
 
virtual void Stop ()
 The interactive's stop method. This method is called right after the user stops or exits the interactive.
 
new void Dispose ()
 Disposes of this Interactive instance. This method is a great place to free up resources being used by the interactive instance, especially right before the interactive itself gets freed from memory.
 

Static Public Member Functions

static string GetTypeNameFromMarker (Node nodeMarker)
 Returns the type name of an InteractiveNode defined in its node marker.

The type name should be defined in the marker's metadata with the entry name type.
 
static Interactive GetHandlerFromMarker (Node nodeMarker)
 Returns an interactive node's handler/operator instance corresponding to a given interactive node marker. If it can't be found, this method returns null.

The handler/operator instance returned is the first found object whose type is Interactive and is a child of the given node marker.

This method is mainly intended to be used for interactive node handlers that have ParentedToNodeMarker set to true.
 

Static Public Attributes

static readonly string NODE_MARKER_NAME_PREFIX = "_Interactive"
 What an interactive's node marker name should begin with.
 

Properties

Node NodeMarker [get]
 The node which indicates that its parent node is the root node of an interactive. Its name should begin with _Interactive
 
Node RootNode [get]
 The interactive's root node.
 
bool ParentedToNodeMarker [get, set]
 Whether or not this interactive node handler is parented to NodeMarker.
 
- Properties inherited from Jumpvalley.Levels.Interactives.Interactive
bool IsInitialized [get, protected set]
 Whether or not Initialize has been called once already.
 
bool IsRunning [get, protected set]
 Whether or not the interactive is running (e.g. after Start has been called).
 
OffsetStopwatch Clock [get]
 The OffsetStopwatch that the Interactive will run on. This stopwatch can be used to synchronize the Interactive's various operations to whatever the current time on this stopwatch is.
 

Additional Inherited Members

- Public Attributes inherited from Jumpvalley.Levels.Interactives.Interactive
object Runner
 The object that's running this interactive.
 

Detailed Description

A subclass of Interactive that operates over a Godot node. It makes using a Godot node's properties and metadata easier. See the relevant wiki section

for details.

Constructor & Destructor Documentation

◆ InteractiveNode()

Jumpvalley.Levels.Interactives.InteractiveNode.InteractiveNode ( OffsetStopwatch stopwatch,
Node nodeMarker )
inline

Creates a new instance of InteractiveNode for a given Stopwatch and Node

Parameters
stopwatchThe stopwatch to bind the interactive to
nodeThe node to operate over

Member Function Documentation

◆ GetHandlerFromMarker()

static Interactive Jumpvalley.Levels.Interactives.InteractiveNode.GetHandlerFromMarker ( Node nodeMarker)
inlinestatic

Returns an interactive node's handler/operator instance corresponding to a given interactive node marker. If it can't be found, this method returns null.

The handler/operator instance returned is the first found object whose type is Interactive and is a child of the given node marker.

This method is mainly intended to be used for interactive node handlers that have ParentedToNodeMarker set to true.

Returns

◆ GetTypeNameFromMarker()

static string Jumpvalley.Levels.Interactives.InteractiveNode.GetTypeNameFromMarker ( Node nodeMarker)
inlinestatic

Returns the type name of an InteractiveNode defined in its node marker.

The type name should be defined in the marker's metadata with the entry name type.

Returns

◆ SetMarkerMeta()

void Jumpvalley.Levels.Interactives.InteractiveNode.SetMarkerMeta ( string name,
Variant value )
inline

Sets the metadata entry belonging to NodeMarker with the given name to the specified value.

Parameters
nameThe name of the metadata entry
valueThe value to set the metadata entry to

◆ TryGetMarkerMeta()

bool Jumpvalley.Levels.Interactives.InteractiveNode.TryGetMarkerMeta ( string name,
out Variant meta )
inline

Attempts to get the value of a metadata entry with a specified name if it exists and assigns it to the meta reference variable.

Parameters
nameThe name of the metadata entry
metaThe reference variable where the metadata entry value should be stored
Returns
true if the metadata entry under the given name was found and grabbing its value was successful, false otherwise.

◆ TryGetMarkerMeta<[MustBeVariant] T >()

bool Jumpvalley.Levels.Interactives.InteractiveNode.TryGetMarkerMeta<[MustBeVariant] T > ( string name,
out T meta )
inline

Version of TryGetMeta(string, out Variant) that outputs the metadata entry value as a specified type T .

Parameters
nameThe name of the metadata entry
metaThe reference variable where the metadata entry value should be stored
Returns
true if the metadata entry under the given name was found and grabbing its value was successful, false otherwise.

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