ManiaMap.Godot
Procedural generation of metroidvania style maps for Godot .NET.
RoomTemplateResource Class Reference

Provides a reference to a room scene and information for the room required by the procedural generator. More...

Inheritance diagram for RoomTemplateResource:

Public Member Functions

override void _ValidateProperty (Godot.Collections.Dictionary property)
 
RoomTemplate GetMMRoomTemplate ()
 Returns the ManiaMap room template used by the procedural generator. More...
 
string GetScenePath ()
 Returns the controlling associated scene path. The uid:// path is prioritized first, then the scene path. More...
 
void Initialize (IRoomNode room)
 Sets the scene paths and serialized text to the room template based on the specified room. More...
 
PackedScene LoadScene ()
 Loads and returns the referenced scene. More...
 
Task< PackedScene > LoadSceneAsync (bool useSubThreads=false)
 Asynchronously loads and returns the referenced scene. More...
 

Properties

bool EditId [getset]
 If true, the Id property becomes editable in the inspector. More...
 
int Id = Rand.GetRandomId() [getset]
 The room template's unique ID. More...
 
string ScenePath [getset]
 The associated scene's path. More...
 
string SceneUidPath [getset]
 The associated scene's uid:// path. More...
 
string SerializedText [getset]
 The serialized text for the ManiaMap room template. More...
 
string TemplateName = "<None>" [getset]
 The template name. More...
 

Private Member Functions

void SetValidatedField< T > (ref T field, T value)
 

Private Attributes

bool _editId
 

Detailed Description

Provides a reference to a room scene and information for the room required by the procedural generator.

Definition at line 14 of file RoomTemplateResource.cs.

Member Function Documentation

◆ _ValidateProperty()

override void _ValidateProperty ( Godot.Collections.Dictionary  property)

Definition at line 54 of file RoomTemplateResource.cs.

◆ GetMMRoomTemplate()

RoomTemplate GetMMRoomTemplate ( )

Returns the ManiaMap room template used by the procedural generator.

Exceptions
RoomTemplateNotInitializedExceptionThrown if the serialized text is null or whitespace, indicating the template has not been initialized.

Definition at line 90 of file RoomTemplateResource.cs.

◆ GetScenePath()

string GetScenePath ( )

Returns the controlling associated scene path. The uid:// path is prioritized first, then the scene path.

Returns
Exceptions
RoomTemplateNotInitializedExceptionThrown if a scene path is null or whitespace, indicating that the template has not been initialized.
PathDoesNotExistExceptionThrown if both the uid:// path and scene path do not exist per the resource loader.

Definition at line 104 of file RoomTemplateResource.cs.

◆ Initialize()

void Initialize ( IRoomNode  room)

Sets the scene paths and serialized text to the room template based on the specified room.

Parameters
roomThe room to associate with the template.

Definition at line 74 of file RoomTemplateResource.cs.

◆ LoadScene()

PackedScene LoadScene ( )

Loads and returns the referenced scene.

Definition at line 121 of file RoomTemplateResource.cs.

◆ LoadSceneAsync()

Task< PackedScene > LoadSceneAsync ( bool  useSubThreads = false)

Asynchronously loads and returns the referenced scene.

Definition at line 129 of file RoomTemplateResource.cs.

◆ SetValidatedField< T >()

void SetValidatedField< T > ( ref T  field,
value 
)
private

Definition at line 48 of file RoomTemplateResource.cs.

Member Data Documentation

◆ _editId

bool _editId
private

Definition at line 16 of file RoomTemplateResource.cs.

Property Documentation

◆ EditId

bool EditId
getset

If true, the Id property becomes editable in the inspector.

Definition at line 20 of file RoomTemplateResource.cs.

◆ Id

int Id = Rand.GetRandomId()
getset

The room template's unique ID.

Definition at line 25 of file RoomTemplateResource.cs.

◆ ScenePath

string ScenePath
getset

The associated scene's path.

Definition at line 35 of file RoomTemplateResource.cs.

◆ SceneUidPath

string SceneUidPath
getset

The associated scene's uid:// path.

Definition at line 40 of file RoomTemplateResource.cs.

◆ SerializedText

string SerializedText
getset

The serialized text for the ManiaMap room template.

Definition at line 46 of file RoomTemplateResource.cs.

◆ TemplateName

string TemplateName = "<None>"
getset

The template name.

Definition at line 30 of file RoomTemplateResource.cs.


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