### Run GenerationPipeline and Get Layout Output Source: https://mpewsey.github.io/ManiaMap.Godot/md_pages_layout_generation_instructions.html Example script that runs a GenerationPipeline and retrieves the generated Layout output. The Run method returns a GenerationResults object; use GetOutput("Layout") to access the layout. The comments suggest saving with JsonSerialization or XmlSerialization, instantiating rooms with RoomTemplateGroupDatabase, or using LayoutTileMap or LayoutTileMapBook nodes. ```csharp using MPewsey.ManiaMap; using MPewsey.ManiaMapGodot.Generators; public partial class ExampleGenerationPipelineRunner : Node { [Export] public GenerationPipeline Pipeline { get; set; } public void RunPipeline() { var results = Pipeline.Run(); var layout = results.GetOutput("Layout"); // At this point, you will probably want to do something with the layout... // // * You could save it to file using the JsonSerialization or XmlSerialization static classes. // * You could use the RoomTemplateGroupDatabase to instantiate the rooms in the layout. // * You could use it with the LayoutTileMap or LayoutTileMapBook nodes to generate maps. // // See the project samples for example implementations. } } ``` -------------------------------- ### Create project settings from property info Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Creates all project settings by iterating over the property info dictionaries. For each setting, if it does not exist, sets the default value, then sets the initial value and adds the property info to ProjectSettings. ```csharp public static void CreateProjectSettings() { foreach (var propertyInfo in GetPropertyInfos()) { var name = propertyInfo["name"].AsString(); var defaultValue = propertyInfo["default_value"]; if (!ProjectSettings.HasSetting(name)) ProjectSettings.SetSetting(name, defaultValue); ProjectSettings.SetInitialValue(name, defaultValue); ProjectSettings.AddPropertyInfo(propertyInfo); } } ``` -------------------------------- ### UidPath Source: https://mpewsey.github.io/ManiaMap.Godot/struct_m_pewsey_1_1_mania_map_godot_1_1_path_ref.html Gets the UID path. ```APIDOC ## string UidPath { get; } ### Description Gets the UID path. ### Property UidPath ### Returns - **string** - The UID path. ``` -------------------------------- ### Initialize(LayoutPack _layoutPack_, Room _roomLayout_, RoomState _roomState_, uint _cellCollisionMask_, bool _assignLayoutPosition_) Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_room_node3_d.html Initializes the room with layout, state, and collision mask. ```APIDOC ## Initialize(LayoutPack _layoutPack_, Room _roomLayout_, RoomState _roomState_, uint _cellCollisionMask_, bool _assignLayoutPosition_) ### Description Initializes the room. The room should be initialized before adding it to the scene tree since cell children often require this information on ready. If the room has already been initialized, no action is taken, and this method returns false. Otherwise, it returns true. ### Method Initialize ### Parameters - **layout** (LayoutPack) - Required - The full layout. - **layoutState** (LayoutState) - Required - The full layout state. - **roomLayout** (Room) - Required - The room's layout. - **roomState** (RoomState) - Required - The room's state. - **doorConnections** (DoorConnections) - Required - The room's door connections. - **cellCollisionMask** (uint) - Required - The cell collision mask. - **assignLayoutPosition** (bool) - Required - If true, the position of the room will be set to that of the room layout. Otherwise, it will be initialized at its original position. ### Returns bool - True if the room was initialized, false if it was already initialized. ``` -------------------------------- ### ResPath Source: https://mpewsey.github.io/ManiaMap.Godot/struct_m_pewsey_1_1_mania_map_godot_1_1_path_ref.html Gets the resource path. ```APIDOC ## string ResPath { get; } ### Description Gets the resource path. ### Property ResPath ### Returns - **string** - The resource path. ``` -------------------------------- ### Run method Source: https://mpewsey.github.io/ManiaMap.Godot/_generation_pipeline_8cs_source.html Builds the pipeline and inputs, then runs the pipeline synchronously. ```C# public PipelineResults Run(Dictionary manualInputs = null, Action logger = null, CancellationToken cancellationToken = default) { return BuildPipeline().Run(BuildInputs(manualInputs), logger, cancellationToken); } ``` -------------------------------- ### CreateRoom3DInstances: Create 3D room instances synchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates 3D room instances for all rooms in the layout synchronously. Uses GetRoomTemplate and LoadScene for each room. ```csharp public List CreateRoom3DInstances(Node parent, LayoutPack layoutPack) { var result = new List(); foreach (var room in layoutPack.Layout.Rooms.Values) { var template = GetRoomTemplate(room.Template.Id); result.Add(RoomNode3D.CreateInstance(room.Id, layoutPack, template.LoadScene(), parent, true)); } return result; } ``` -------------------------------- ### Value Property Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_generators_1_1_generation_boolean_input.html Gets or sets the boolean input value. ```APIDOC ## Value Property ### Description The input value. ### Type bool ### Access Gets or sets. ``` -------------------------------- ### CreateInstance() [2/2] Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_room_node2_d.html Creates and initializes an instance of a room using a room ID, layout pack, scene, parent, and optional layout position flag. The layout and layout state are assigned based on the current ManiaMapManager. ```APIDOC ## CreateInstance() [2/2] ### Description Creates and initializes an instance of a room. The layout and layout state are assigned to the room based on the current ManiaMapManager. ### Method CreateInstance (static) ### Parameters - **id** (Uid) - Required - The room ID. - **layoutPack** (LayoutPack) - Required - The layout pack. - **scene** (PackedScene) - Required - The room scene. - **parent** (Node) - Required - The node to which the room will be added as a child. - **assignLayoutPosition** (bool) - Optional - If true, the position of the room will be set to that of the room layout. Otherwise, it will be initialized at its original position. Default is false. ### Return Type RoomNode2D ``` -------------------------------- ### MapTileSet.TopDoor Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the top door tile. ```APIDOC ## TopDoor ### Description Gets or sets the atlas coordinate of the top door tile. ### Property `Vector2I TopDoor { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the top door tile. ### Remarks Defined at line 78 of MapTileSet.cs. ``` -------------------------------- ### MapTileSet.WestDoor Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the west door tile. ```APIDOC ## WestDoor ### Description Gets or sets the atlas coordinate of the west door tile. ### Property `Vector2I WestDoor { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the west door tile. ### Remarks Defined at line 72 of MapTileSet.cs. ``` -------------------------------- ### CreateInstance() [1/2] Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_room_node2_d.html Creates and initializes an instance of a room with the given scene, parent, layout pack, room layout, room state, collision mask, and layout position flag. ```APIDOC ## CreateInstance() [1/2] ### Description Creates and initializes an instance of a room. ### Method CreateInstance (static) ### Parameters - **scene** (PackedScene) - Required - The room scene. - **parent** (Node) - Required - The node to which the room will be added as a child. - **layoutPack** (LayoutPack) - Required - The layout pack. - **roomLayout** (Room) - Required - The room's layout. - **roomState** (RoomState) - Required - The room's state. - **cellCollisionMask** (uint) - Required - The cell collision mask. - **assignLayoutPosition** (bool) - Required - If true, the position of the room will be set to that of the room layout. Otherwise, it will be initialized at its original position. ### Return Type RoomNode2D ``` -------------------------------- ### MapTileSet.SouthDoor Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the south door tile. ```APIDOC ## SouthDoor ### Description Gets or sets the atlas coordinate of the south door tile. ### Property `Vector2I SouthDoor { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the south door tile. ### Remarks Defined at line 66 of MapTileSet.cs. ``` -------------------------------- ### Initialize(IRoomNode _room_) Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_room_template_resource.html Sets the scene paths and serialized text to the room template based on the specified room. ```APIDOC ## Initialize(IRoomNode _room_) ### Description Sets the scene paths and serialized text to the room template based on the specified room. ### Method Initialize ### Parameters - **room** (IRoomNode) - The room to associate with the template. ``` -------------------------------- ### MapTileSet.NorthDoor Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the north door tile. ```APIDOC ## NorthDoor ### Description Gets or sets the atlas coordinate of the north door tile. ### Property `Vector2I NorthDoor { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the north door tile. ### Remarks Defined at line 54 of MapTileSet.cs. ``` -------------------------------- ### C# RoomNode2D _Ready initialization with editor hint and exception Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node2_d_8cs_source.html Initializes the room by sizing cells and creating a gizmo in the editor, otherwise throws RoomNotInitializedException if not initialized. ```csharp public override void _Ready() { base._Ready(); #if TOOLS if (Engine.IsEditorHint()) { this.SizeActiveCells(); Editor.CellGrid2DGizmo.CreateInstance(this); return; } #endif if (!IsInitialized) throw new RoomNotInitializedException($"Room is not initialized: {this}"); } ``` -------------------------------- ### CreateRoom3DInstance: Create single 3D room instance synchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates a single 3D room instance synchronously. Uses GetRoomTemplate(id, layoutPack).LoadScene() and RoomNode3D.CreateInstance with assignLayoutPosition parameter. ```csharp public RoomNode3D CreateRoom3DInstance(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false) { var scene = GetRoomTemplate(id, layoutPack).LoadScene(); return RoomNode3D.CreateInstance(id, layoutPack, scene, parent, assignLayoutPosition); } ``` -------------------------------- ### MapTileSet.WestWall Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the west wall tile. ```APIDOC ## WestWall ### Description Gets or sets the atlas coordinate of the west wall tile. ### Property `Vector2I WestWall { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the west wall tile. ### Remarks Defined at line 48 of MapTileSet.cs. ``` -------------------------------- ### MapTileSet.SouthWall Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the south wall tile. ```APIDOC ## SouthWall ### Description Gets or sets the atlas coordinate of the south wall tile. ### Property `Vector2I SouthWall { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the south wall tile. ### Remarks Defined at line 42 of MapTileSet.cs. ``` -------------------------------- ### CreateRoom3DInstancesAsync: Create 3D room instances asynchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates 3D room instances for all rooms in the layout. Uses LoadScenesAsync to load scenes and RoomNode3D.CreateInstance for each room. ```csharp public async Task> CreateRoom3DInstancesAsync(Node parent, LayoutPack layoutPack, bool useSubThreads = false) { var rooms = layoutPack.Layout.Rooms.Values.ToList(); var scenes = await LoadScenesAsync(rooms, useSubThreads); var result = new List(rooms.Count); foreach (var room in rooms) { var scene = scenes[room.Template.Id]; result.Add(RoomNode3D.CreateInstance(room.Id, layoutPack, scene, parent, true)); } return result; } ``` -------------------------------- ### MapTileSet.NorthWall Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the atlas coordinate of the north wall tile. ```APIDOC ## NorthWall ### Description Gets or sets the atlas coordinate of the north wall tile. ### Property `Vector2I NorthWall { get; set; }` ### Type - **Vector2I** - The atlas coordinate of the north wall tile. ### Remarks Defined at line 30 of MapTileSet.cs. ``` -------------------------------- ### CellArea3D._Ready() Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_cell_area3_d.html Called when the node is ready. This method is part of the Godot lifecycle and is overridden to set up the area's signal connections. ```APIDOC ## CellArea3D._Ready() ### Description Called when the node is ready. This method is part of the Godot lifecycle and is overridden to set up the area's signal connections. ### Method Override void _Ready() ``` -------------------------------- ### Size Property Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_door_threshold3_d.html Gets or sets the width, height, and depth of the threshold. ```APIDOC ## Size Property ### Description Gets or sets the width, height, and depth of the threshold. ### Property Vector3 Size ### Access Get/Set ``` -------------------------------- ### CreateRoom2DInstance: Create single 2D room instance synchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates a single 2D room instance synchronously. Uses GetRoomTemplate(id, layoutPack).LoadScene() and RoomNode2D.CreateInstance with assignLayoutPosition parameter. ```csharp public RoomNode2D CreateRoom2DInstance(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false) { var scene = GetRoomTemplate(id, layoutPack).LoadScene(); return RoomNode2D.CreateInstance(id, layoutPack, scene, parent, assignLayoutPosition); } ``` -------------------------------- ### MapTileSet.TileSet Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets or sets the TileSet resource associated with this map tile set. ```APIDOC ## TileSet ### Description Gets or sets the TileSet resource associated with this map tile set. ### Property `TileSet TileSet { get; set; }` ### Type - **TileSet** - The tile set resource. ### Remarks Defined at line 17 of MapTileSet.cs. ``` -------------------------------- ### NodeEdgeIndexes(int _nodeId_) Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_graphs_1_1_layout_graph_resource.html Gets all edge indexes that are connected to a given node. ```APIDOC ## NodeEdgeIndexes(int _nodeId_) ### Description Returns a list of all edge indexes associated with the node. ### Method NodeEdgeIndexes ### Parameters - **nodeId** (int) - Required - The node ID. ### Returns List - A list of edge indexes associated with the node. ``` -------------------------------- ### BoxGizmo.cs - Full class implementation Source: https://mpewsey.github.io/ManiaMap.Godot/_box_gizmo_8cs_source.html Complete source of BoxGizmo, a Godot editor tool that creates a 3D box gizmo for DoorThreshold3D. It uses ManiaMapResources materials and ManiaMapProjectSettings for colors, and updates the gizmo scale and shader parameters when the threshold size changes. ```csharp #if TOOLS using Godot; namespace MPewsey.ManiaMapGodot.Editor { [Tool] public partial class BoxGizmo : MeshInstance3D { private static StringName AlbedoParameterName { get; } = "albedo"; public static BoxGizmo CreateInstance(DoorThreshold3D threshold) { var material = ManiaMapResources.Materials.AlbedoMaterial; var gizmo = new BoxGizmo() { Mesh = new BoxMesh(), MaterialOverride = material }; var edges = new MeshInstance3D() { Mesh = CreateCubeEdgeMesh(), MaterialOverride = material }; threshold.OnSizeChanged += gizmo.OnDoorThreshold3DSizeChanged; gizmo.AddChild(edges); threshold.AddChild(gizmo); gizmo.OnDoorThreshold3DSizeChanged(threshold.Size); return gizmo; } private void OnDoorThreshold3DSizeChanged(Vector3 size) { Scale = size * GetParent().Scale; var lineColor = ManiaMapProjectSettings.GetDoorThreshold3DLineColor(); var fillColor = ManiaMapProjectSettings.GetDoorThreshold3DFillColor(); SetInstanceShaderParameter(AlbedoParameterName, fillColor); var edges = GetChild(0); edges.SetInstanceShaderParameter(AlbedoParameterName, lineColor); } public static ArrayMesh CreateCubeEdgeMesh(float size = 1) { var mesh = new ArrayMesh(); var tool = new SurfaceTool(); tool.Begin(Mesh.PrimitiveType.Lines); var scale = 0.5f * size; var a = new Vector3(-1, -1, -1) * scale; var b = new Vector3(1, -1, -1) * scale; var c = new Vector3(1, 1, -1) * scale; var d = new Vector3(-1, 1, -1) * scale; var e = new Vector3(-1, -1, 1) * scale; var f = new Vector3(1, -1, 1) * scale; var g = new Vector3(1, 1, 1) * scale; var h = new Vector3(-1, 1, 1) * scale; // Back side tool.AddVertex(a); tool.AddVertex(b); tool.AddVertex(b); tool.AddVertex(c); tool.AddVertex(c); tool.AddVertex(d); tool.AddVertex(d); tool.AddVertex(a); // Front side tool.AddVertex(e); tool.AddVertex(f); tool.AddVertex(f); tool.AddVertex(g); tool.AddVertex(g); tool.AddVertex(h); tool.AddVertex(h); tool.AddVertex(e); // Left side tool.AddVertex(a); tool.AddVertex(e); tool.AddVertex(d); tool.AddVertex(h); // Right side tool.AddVertex(b); tool.AddVertex(f); tool.AddVertex(c); tool.AddVertex(g); tool.Commit(mesh); return mesh; } } } #endif ``` -------------------------------- ### C# RoomNode2D Initialize method Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node2_d_8cs_source.html Initializes the room with layout data, sets layout pack, room layout, and room state, optionally moves to layout position, creates the cell areas, and marks as initialized. ```csharp public bool Initialize(LayoutPack layoutPack, Room roomLayout, RoomState roomState, uint cellCollisionMask, bool assignLayoutPosition) { if (IsInitialized) return false; LayoutPack = layoutPack; RoomLayout = roomLayout; RoomState = roomState; if (assignLayoutPosition) MoveToLayoutPosition(); CreateCellAreas(cellCollisionMask); IsInitialized = true; return true; } ``` -------------------------------- ### RoomNode2D.CellCenterLocalPosition Source: https://mpewsey.github.io/ManiaMap.Godot/_cell_area2_d_8cs_source.html Method to get the local position of a cell center within a room. ```APIDOC ## [METHOD] RoomNode2D.CellCenterLocalPosition(int row, int column) ### Description Returns the cell center local position for the specified cell index. ### Method Instance method ### Signature `public Vector2 CellCenterLocalPosition(int row, int column)` ### Parameters - **row** (int) - Required - The row index of the cell. - **column** (int) - Required - The column index of the cell. ### Return Value - **Vector2** - The local position of the cell center. ``` -------------------------------- ### InputName Property Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_generators_1_1_generation_boolean_input.html Gets or sets the input name. Default value is "". ```APIDOC ## InputName Property ### Description The input name. ### Type string ### Default Value "" ### Access Gets or sets. ``` -------------------------------- ### CreateRoom3DInstanceAsync: Create single 3D room instance asynchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates a single 3D room instance asynchronously. Uses GetRoomTemplate(id, layoutPack).LoadSceneAsync(useSubThreads) and RoomNode3D.CreateInstance with assignLayoutPosition parameter. ```csharp public async Task CreateRoom3DInstanceAsync(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false, bool useSubThreads = false) { var scene = await GetRoomTemplate(id, layoutPack).LoadSceneAsync(useSubThreads); return RoomNode3D.CreateInstance(id, layoutPack, scene, parent, assignLayoutPosition); } ``` -------------------------------- ### CreateRoom2DInstanceAsync Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Asynchronously creates a room from the current Layout. Returns the instantiated room. ```APIDOC ## CreateRoom2DInstanceAsync ### Description Asynchronously creates a room from the current Layout. Returns the instantiated room. ### Method CreateRoom2DInstanceAsync ### Signature async Task CreateRoom2DInstanceAsync(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false, bool useSubThreads = false) ### Parameters - **id** (Uid) - Required - The unique identifier of the room to create. - **layoutPack** (LayoutPack) - Required - The layout pack containing the layout data. - **parent** (Node) - Required - The parent node for the instantiated room. - **assignLayoutPosition** (bool) - Optional - Whether to assign the layout position to the room. - **useSubThreads** (bool) - Optional - Whether to use sub-threads for asynchronous loading. ### Returns - **Task** - A task that resolves to the instantiated room node. ``` -------------------------------- ### GenerationFloatInput.Value Property Source: https://mpewsey.github.io/ManiaMap.Godot/_generation_float_input_8cs_source.html Gets or sets the float input value. This is the value that will be added to the pipeline inputs. ```APIDOC ## Value Property ### Description The input value. ### Property Signature [Export] public float Value { get; set; } ### Default Value 0 ### Remarks This property is exported for use in the Godot editor. ``` -------------------------------- ### CreateRoom2DInstances: Create 2D room instances synchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates 2D room instances for a given z-coordinate synchronously. Uses GetRoomTemplate and LoadScene for each room. The z parameter defaults to the first room's Z position. ```csharp public List CreateRoom2DInstances(Node parent, LayoutPack layoutPack, int? z = null) { z ??= layoutPack.Layout.Rooms.Values.Select(x => x.Position.Z).First(); var result = new List(); foreach (var room in layoutPack.Layout.Rooms.Values) { if (room.Position.Z == z) { var template = GetRoomTemplate(room.Template.Id); result.Add(RoomNode2D.CreateInstance(room.Id, layoutPack, template.LoadScene(), parent, true)); } } return result; } ``` -------------------------------- ### GenerationFloatInput.InputName Property Source: https://mpewsey.github.io/ManiaMap.Godot/_generation_float_input_8cs_source.html Gets or sets the input name. This is the name used to identify the input in the pipeline. ```APIDOC ## InputName Property ### Description The input name. ### Property Signature [Export] public string InputName { get; set; } ### Default Value "" ### Remarks This property is exported for use in the Godot editor. ``` -------------------------------- ### GroupName Property Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_collectable_group.html The unique group name. This property gets or sets the name that uniquely identifies the group. ```APIDOC ## GroupName Property ### Description The unique group name. ### Property string GroupName ### Access Gets or sets the value. ### Default Value "" ``` -------------------------------- ### Create RoomNode3D instance by Uid Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node3_d_8cs_source.html Creates a RoomNode3D instance from a layout pack using the room's Uid. Retrieves the room layout, state, and collision mask from the pack, then delegates to the overloaded CreateInstance method. ```csharp public static RoomNode3D CreateInstance(Uid id, LayoutPack layoutPack, PackedScene scene, Node parent, bool assignLayoutPosition = false) { var roomLayout = layoutPack.Layout.Rooms[id]; var roomState = layoutPack.LayoutState.RoomStates[id]; var collisionMask = layoutPack.Settings.CellCollisionMask; return CreateInstance(scene, parent, layoutPack, roomLayout, roomState, collisionMask, assignLayoutPosition); } ``` -------------------------------- ### Run(Dictionary _manualInputs_ = null, Action _logger_ = null, CancellationToken _cancellationToken_ = default) Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_generators_1_1_generation_pipeline.html Runs the pipeline synchronously and returns the results. ```APIDOC ## Run(Dictionary _manualInputs_ = null, Action _logger_ = null, CancellationToken _cancellationToken_ = default) ### Description Runs the pipeline synchronously and returns the results. ### Method Run ### Signature `PipelineResults Run(Dictionary _manualInputs_ = null, Action _logger_ = null, CancellationToken _cancellationToken_ = default)` ### Parameters - **_manualInputs_** (Dictionary) - Optional - A dictionary of manual inputs. If null, no manual inputs will be used. - **_logger_** (Action) - Optional - The delegate invoked when pipeline log messages and issues. If null, no logs will be issues. - **_cancellationToken_** (CancellationToken) - Optional - The pipeline cancellation token. ### Returns - **PipelineResults** - The results of the pipeline run. ``` -------------------------------- ### MapTileSet.TileCoordinates Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_map_tile_set.html Gets a dictionary of tile atlas coordinates by name. This property is private and not intended for direct external use. ```APIDOC ## TileCoordinates ### Description Gets a dictionary of tile atlas coordinates by name. This property is private and not intended for direct external use. ### Property `Dictionary TileCoordinates { get; }` ### Type - **Dictionary** - A dictionary of tile atlas coordinates by name. ### Remarks Defined at line 95 of MapTileSet.cs. This property is private and not part of the public API. ``` -------------------------------- ### CreateRoom3DInstance Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates a room from the current Layout. Returns the instantiated room. ```APIDOC ## CreateRoom3DInstance ### Description Creates a room from the current Layout. Returns the instantiated room. ### Method CreateRoom3DInstance ### Signature RoomNode3D CreateRoom3DInstance(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false) ### Parameters - **id** (Uid) - Required - The unique identifier of the room to create. - **layoutPack** (LayoutPack) - Required - The layout pack containing the layout data. - **parent** (Node) - Required - The parent node for the instantiated room. - **assignLayoutPosition** (bool) - Optional - Whether to assign the layout position to the room. ### Returns - **RoomNode3D** - The instantiated room node. ``` -------------------------------- ### Entries Property Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_collectable_group.html An array of entries. This property gets or sets the collection of CollectableGroupEntry objects that define the quantities of each collectable. ```APIDOC ## Entries Property ### Description An array of entries. ### Property CollectableGroupEntry[] Entries ### Access Gets or sets the value. ### Default Value Array.Empty() ``` -------------------------------- ### _Ready() Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_drawing_1_1_layout_tile_map_book.html Override method called when the node is ready. ```APIDOC ## _Ready() ### Description Override method called when the node is ready. ### Method _Ready ### Parameters None ### Returns void ``` -------------------------------- ### CreateCellAreas() Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_room_node2_d.html Creates CellArea2D instances for all active cells in the room. This is a private method used internally during room setup. ```APIDOC ## CreateCellAreas() ### Description Creates CellArea2D for all active cells. ### Method CreateCellAreas ### Parameters - **cellCollisionMask** (uint) - Required - The cell collision mask. ### Return Type void ``` -------------------------------- ### CreateRoom2DInstance Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates a room from the current Layout. Returns the instantiated room. ```APIDOC ## CreateRoom2DInstance ### Description Creates a room from the current Layout. Returns the instantiated room. ### Method CreateRoom2DInstance ### Signature RoomNode2D CreateRoom2DInstance(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false) ### Parameters - **id** (Uid) - Required - The unique identifier of the room to create. - **layoutPack** (LayoutPack) - Required - The layout pack containing the layout data. - **parent** (Node) - Required - The parent node for the instantiated room. - **assignLayoutPosition** (bool) - Optional - Whether to assign the layout position to the room. ### Returns - **RoomNode2D** - The instantiated room node. ``` -------------------------------- ### ResourceIsSavedToFile helper method Source: https://mpewsey.github.io/ManiaMap.Godot/_i_room_node_extensions_8cs_source.html Checks if a resource is saved to a file by verifying its ResourcePath is not empty and does not start with the scene file path. ```csharp private static bool ResourceIsSavedToFile(Resource resource, string sceneFilePath) { var path = resource.ResourcePath; return !string.IsNullOrEmpty(path) && !path.StartsWith(sceneFilePath); } ``` -------------------------------- ### Room _Ready initialization with editor check Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node3_d_8cs_source.html Initializes the room. In editor mode, sizes active cells and creates a CellGrid3DGizmo instance. In runtime, throws RoomNotInitializedException if not initialized. ```csharp public override void _Ready() { base._Ready(); #if TOOLS if (Engine.IsEditorHint()) { this.SizeActiveCells(); Editor.CellGrid3DGizmo.CreateInstance(this); return; } #endif if (!IsInitialized) throw new RoomNotInitializedException($"Room is not initialized: {this}"); } ``` -------------------------------- ### Get template groups from nodes and edges Source: https://mpewsey.github.io/ManiaMap.Godot/_layout_graph_resource_8cs_source.html Collects the unique TemplateGroup values from all nodes and non-null edge template groups into a HashSet. ```csharp public HashSet GetTemplateGroups() { var result = new HashSet(); foreach (var node in Nodes.Values) { result.Add(node.TemplateGroup); } foreach (var edge in Edges.Values) { if (edge.TemplateGroup != null) result.Add(edge.TemplateGroup); } return result; } ``` -------------------------------- ### _Ready Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_cell_area2_d.html Override of the Godot _Ready method, called when the node enters the scene tree. ```APIDOC ## _Ready() ### Description Called when the node enters the scene tree. Overrides the base _Ready method. ``` -------------------------------- ### Get cell center local position Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node3_d_8cs_source.html Calculates the local position of a cell's center based on its row and column indices and the cell size. ```csharp public Vector3 CellCenterLocalPosition(int row, int column) { return new Vector3(column * CellSize.X, 0, row * CellSize.Z) + 0.5f * CellSize; } ``` -------------------------------- ### CreateRoom3DInstanceAsync Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Asynchronously creates a room from the current Layout. Returns the instantiated room. ```APIDOC ## CreateRoom3DInstanceAsync ### Description Asynchronously creates a room from the current Layout. Returns the instantiated room. ### Method CreateRoom3DInstanceAsync ### Signature async Task CreateRoom3DInstanceAsync(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false, bool useSubThreads = false) ### Parameters - **id** (Uid) - Required - The unique identifier of the room to create. - **layoutPack** (LayoutPack) - Required - The layout pack containing the layout data. - **parent** (Node) - Required - The parent node for the instantiated room. - **assignLayoutPosition** (bool) - Optional - Whether to assign the layout position to the room. - **useSubThreads** (bool) - Optional - Whether to use sub-threads for asynchronous loading. ### Returns - **Task** - A task that resolves to the instantiated room node. ``` -------------------------------- ### IDoorNodeExtensions Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_i_door_node_extensions.html Extension methods for IDoorNode that provide functionality for checking door existence, finding door connections, retrieving the ManiaMap door, and getting the connected room ID. ```APIDOC ## DoorExists(this IDoorNode door) ### Description Returns true if a connection exists within the `Layout` for the door. ### Method static bool DoorExists(this IDoorNode door) ### Parameters - **door** (IDoorNode) - Required - The door node to check. ### Returns - **bool** - True if a connection exists within the `Layout` for the door. ``` ```APIDOC ## FindDoorConnection(this IDoorNode door) ### Description Returns the associated door connection within the `Layout`. If the door does not have a connect, returns null. ### Method static DoorConnection FindDoorConnection(this IDoorNode door) ### Parameters - **door** (IDoorNode) - Required - The door node to find the connection for. ### Returns - **DoorConnection** - The associated door connection within the `Layout`, or null if the door does not have a connection. ``` ```APIDOC ## GetMMDoor(this IDoorNode door) ### Description Returns the ManiaMap door used for procedural generation. ### Method static Door GetMMDoor(this IDoorNode door) ### Parameters - **door** (IDoorNode) - Required - The door node to get the ManiaMap door for. ### Returns - **Door** - The ManiaMap door used for procedural generation. ``` ```APIDOC ## ToRoomId(this IDoorNode door) ### Description Returns the ID of the room to which this door connects. If this door does not exist, returns Uid(-1, -1, -1). ### Method static Uid ToRoomId(this IDoorNode door) ### Parameters - **door** (IDoorNode) - Required - The door node to get the room ID for. ### Returns - **Uid** - The ID of the room to which this door connects, or Uid(-1, -1, -1) if the door does not exist. ``` -------------------------------- ### Get cell center global position Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node3_d_8cs_source.html Returns the global position of a cell's center by adding the room's global position to the local center position. ```csharp public Vector3 CellCenterGlobalPosition(int row, int column) { return CellCenterLocalPosition(row, column) + GlobalPosition; } ``` -------------------------------- ### RunAsync method Source: https://mpewsey.github.io/ManiaMap.Godot/_generation_pipeline_8cs_source.html Builds the pipeline and inputs, then runs the pipeline asynchronously. ```C# public Task RunAsync(Dictionary manualInputs = null, Action logger = null, CancellationToken cancellationToken = default) { return BuildPipeline().RunAsync(BuildInputs(manualInputs), logger, cancellationToken); } ``` -------------------------------- ### Get DoorThreshold3D line color setting Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Retrieves the DoorThreshold3D line color setting from ProjectSettings, returning the default value if not set. Uses AsColor() to convert the setting value. ```csharp public static Color GetDoorThreshold3DLineColor() { return ProjectSettings.GetSetting(DoorThreshold3DLineColorSetting, DoorThreshold3DLineColorDefaultValue).AsColor(); } ``` -------------------------------- ### CreateRoom2DInstancesAsync: Create 2D room instances asynchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates 2D room instances for a given z-coordinate. Uses LoadScenesAsync to load scenes and RoomNode2D.CreateInstance for each room. The z parameter defaults to the first room's Z position. ```csharp public async Task> CreateRoom2DInstancesAsync(Node parent, LayoutPack layoutPack, int? z = null, bool useSubThreads = false) { z ??= layoutPack.Layout.Rooms.Values.Select(x => x.Position.Z).First(); var rooms = layoutPack.Layout.Rooms.Values.Where(x => x.Position.Z == z).ToList(); var scenes = await LoadScenesAsync(rooms, useSubThreads); var result = new List(rooms.Count); foreach (var room in rooms) { var scene = scenes[room.Template.Id]; result.Add(RoomNode2D.CreateInstance(room.Id, layoutPack, scene, parent, true)); } return result; } ``` -------------------------------- ### Get DoorThreshold3D fill color setting Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Retrieves the DoorThreshold3D fill color setting from ProjectSettings, returning the default value if not set. Uses AsColor() to convert the setting value. ```csharp public static Color GetDoorThreshold3DFillColor() { return ProjectSettings.GetSetting(DoorThreshold3DFillColorSetting, DoorThreshold3DFillColorDefaultValue).AsColor(); } ``` -------------------------------- ### CreateRoom3DInstances Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates rooms at their layout positions for the current Layout. Returns a list of the instantiated rooms. ```APIDOC ## CreateRoom3DInstances ### Description Creates rooms at their layout positions for the current Layout. Returns a list of the instantiated rooms. ### Method CreateRoom3DInstances ### Signature List CreateRoom3DInstances(Node parent, LayoutPack layoutPack) ### Parameters - **parent** (Node) - Required - The parent node for the instantiated rooms. - **layoutPack** (LayoutPack) - Required - The layout pack containing the layout data. ### Returns - **List** - A list of the instantiated room nodes. ``` -------------------------------- ### Get DoorThreshold2D line color setting Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Retrieves the DoorThreshold2D line color setting from ProjectSettings, returning the default value if not set. Uses AsColor() to convert the setting value. ```csharp public static Color GetDoorThreshold2DLineColor() { return ProjectSettings.GetSetting(DoorThreshold2DLineColorSetting, DoorThreshold2DLineColorDefaultValue).AsColor(); } ``` -------------------------------- ### RoomNode3D.Initialize Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node3_d_8cs_source.html Initializes the room. The room should be initialized before adding it to the scene tree since cell ch... ```APIDOC ## RoomNode3D.Initialize ### Description Initializes the room. The room should be initialized before adding it to the scene tree since cell ch... ### Method bool Initialize(LayoutPack layoutPack, Room roomLayout, RoomState roomState, uint cellCollisionMask, bool assignLayoutPosition) ### Parameters - **layoutPack** (LayoutPack) - Required - The layout pack. - **roomLayout** (Room) - Required - The room layout. - **roomState** (RoomState) - Required - The room state. - **cellCollisionMask** (uint) - Required - The cell collision mask. - **assignLayoutPosition** (bool) - Required - Whether to assign the layout position. ### Returns bool ``` -------------------------------- ### Get DoorThreshold2D fill color setting Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Retrieves the DoorThreshold2D fill color setting from ProjectSettings, returning the default value if not set. Uses AsColor() to convert the setting value. ```csharp public static Color GetDoorThreshold2DFillColor() { return ProjectSettings.GetSetting(DoorThreshold2DFillColorSetting, DoorThreshold2DFillColorDefaultValue).AsColor(); } ``` -------------------------------- ### CreateRoom3DInstancesAsync Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Asynchronously creates rooms at their layout positions for the current Layout. Returns a list of the instantiated rooms. ```APIDOC ## CreateRoom3DInstancesAsync ### Description Asynchronously creates rooms at their layout positions for the current Layout. Returns a list of the instantiated rooms. ### Method CreateRoom3DInstancesAsync ### Signature async Task> CreateRoom3DInstancesAsync(Node parent, LayoutPack layoutPack, bool useSubThreads = false) ### Parameters - **parent** (Node) - Required - The parent node for the instantiated rooms. - **layoutPack** (LayoutPack) - Required - The layout pack containing the layout data. - **useSubThreads** (bool) - Optional - Whether to use sub-threads for asynchronous loading. ### Returns - **Task>** - A task that resolves to a list of the instantiated room nodes. ``` -------------------------------- ### C# RoomNode2D CreateInstance from layout pack with Uid Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node2_d_8cs_source.html Creates a RoomNode2D instance using layout pack data, retrieving room layout and state by Uid and the collision mask from settings. ```csharp public static RoomNode2D CreateInstance(Uid id, LayoutPack layoutPack, PackedScene scene, Node parent, bool assignLayoutPosition = false) { var roomLayout = layoutPack.Layout.Rooms[id]; var roomState = layoutPack.LayoutState.RoomStates[id]; var collisionMask = layoutPack.Settings.CellCollisionMask; return CreateInstance(scene, parent, layoutPack, roomLayout, roomState, collisionMask, assignLayoutPosition); } ``` -------------------------------- ### Create cell areas loop Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node3_d_8cs_source.html Starts creating cell areas for each active cell row. The loop iterates over ActiveCells and retrieves each row; the method body is truncated in the source. ```csharp private void CreateCellAreas(uint cellCollisionMask) { for (int i = 0; i < ActiveCells.Count; i++) { var row = ActiveCells[i]; ``` -------------------------------- ### C# RoomNode2D FindClosestDoorDirection (partial) method start Source: https://mpewsey.github.io/ManiaMap.Godot/_room_node2_d_8cs_source.html Begins the method that finds the closest door direction for a given cell. The snippet is truncated at the point where the directions array is initialized. ```csharp public DoorDirection FindClosestDoorDirection(int row, int column, Vector2 position) { Span directions = stackalloc DoorDirection[] { DoorDirection.North, ``` -------------------------------- ### RoomNode3D Static Methods Source: https://mpewsey.github.io/ManiaMap.Godot/class_m_pewsey_1_1_mania_map_godot_1_1_room_node3_d.html Static factory methods for creating RoomNode3D instances. ```APIDOC ## CreateInstance(PackedScene scene, Node parent, LayoutPack layoutPack, Room roomLayout, RoomState roomState, uint cellCollisionMask, bool assignLayoutPosition) ### Description Creates and initializes an instance of a room. ### Method CreateInstance ### Parameters - **scene** (PackedScene) - Required - The scene to instantiate. - **parent** (Node) - Required - The parent node for the new room. - **layoutPack** (LayoutPack) - Required - The layout pack to use. - **roomLayout** (Room) - Required - The room layout. - **roomState** (RoomState) - Required - The room state. - **cellCollisionMask** (uint) - Required - The collision mask for cells. - **assignLayoutPosition** (bool) - Required - Whether to assign the layout position. ### Returns - **RoomNode3D** - The created room node. ``` ```APIDOC ## CreateInstance(Uid id, LayoutPack layoutPack, PackedScene scene, Node parent, bool assignLayoutPosition=false) ### Description Creates and initializes an instance of a room. The layout and layout state are assigned to the room based on the current ManiaMapManager. ### Method CreateInstance ### Parameters - **id** (Uid) - Required - The unique identifier for the room. - **layoutPack** (LayoutPack) - Required - The layout pack to use. - **scene** (PackedScene) - Required - The scene to instantiate. - **parent** (Node) - Required - The parent node for the new room. - **assignLayoutPosition** (bool) - Optional - Whether to assign the layout position. Default is false. ### Returns - **RoomNode3D** - The created room node. ``` -------------------------------- ### Get Room3D cell line color setting Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Retrieves the Room3D cell line color setting from ProjectSettings, returning the default value if not set. Uses AsColor() to convert the setting value. ```csharp public static Color GetRoom3DCellLineColor() { return ProjectSettings.GetSetting(Room3DCellLineColorSetting, Room3DCellLineColorDefaultValue).AsColor(); } ``` -------------------------------- ### Get Room3D inactive cell color setting Source: https://mpewsey.github.io/ManiaMap.Godot/_mania_map_project_settings_8cs_source.html Retrieves the Room3D inactive cell color setting from ProjectSettings, returning the default value if not set. Uses AsColor() to convert the setting value. ```csharp public static Color GetRoom3DInactiveCellColor() { return ProjectSettings.GetSetting(Room3DInactiveCellColorSetting, Room3DInactiveCellColorDefaultValue).AsColor(); } ``` -------------------------------- ### CreateRoom2DInstanceAsync: Create single 2D room instance asynchronously Source: https://mpewsey.github.io/ManiaMap.Godot/_room_template_database_8cs_source.html Creates a single 2D room instance asynchronously. Uses GetRoomTemplate(id, layoutPack).LoadSceneAsync(useSubThreads) and RoomNode2D.CreateInstance with assignLayoutPosition parameter. ```csharp public async Task CreateRoom2DInstanceAsync(Uid id, LayoutPack layoutPack, Node parent, bool assignLayoutPosition = false, bool useSubThreads = false) { var scene = await GetRoomTemplate(id, layoutPack).LoadSceneAsync(useSubThreads); return RoomNode2D.CreateInstance(id, layoutPack, scene, parent, assignLayoutPosition); } ``` -------------------------------- ### RoomTemplateResource.Initialize Source: https://mpewsey.github.io/ManiaMap.Godot/_i_room_node_extensions_8cs_source.html Initializes the room template resource with scene paths and serialized text from a given room node. ```APIDOC ## [METHOD] [ENDPOINT] ### Description Sets the scene paths and serialized text to the room template based on the specified room. ### Method void ### Endpoint RoomTemplateResource.Initialize(IRoomNode room) ### Parameters - **room** (IRoomNode) - Required - The room node to initialize from. ### Request Example No request body documented. ### Response #### Success Response No return value. #### Response Example No response example documented. ```