ManiaMap.Godot
Procedural generation of metroidvania style maps for Godot .NET.
TemplateGroupEntry.cs
1using Godot;
2using MPewsey.ManiaMap;
3using System.Collections.Generic;
4
6{
10 [Tool]
11 [GlobalClass]
12 public partial class TemplateGroupEntry : Resource
13 {
17 [Export] public RoomTemplateResource RoomTemplate { get; set; }
18
22 [Export(PropertyHint.Range, "0,100,1,or_greater")] public int MinQuantity { get; set; }
23
27 [Export(PropertyHint.Range, "0,100,1,or_greater")] public int MaxQuantity { get; set; } = int.MaxValue;
28
33 public TemplateGroupsEntry GetMMTemplateGroupsEntry(Dictionary<RoomTemplateResource, RoomTemplate> templateCache)
34 {
35 if (!templateCache.TryGetValue(RoomTemplate, out var template))
36 {
38 templateCache.Add(RoomTemplate, template);
39 }
40
41 return new TemplateGroupsEntry(template, MinQuantity, MaxQuantity);
42 }
43 }
44}
Provides a reference to a room scene and information for the room required by the procedural generato...
RoomTemplate GetMMRoomTemplate()
Returns the ManiaMap room template used by the procedural generator.
A TemplateGroup entry with a room template and its constraints.
int MaxQuantity
The maximum quantity of rooms with this template to include in the layout.
TemplateGroupsEntry GetMMTemplateGroupsEntry(Dictionary< RoomTemplateResource, RoomTemplate > templateCache)
Returns a new ManiaMap template groups entry for use by the procedural generator.
int MinQuantity
The minimum quantity of rooms with this template to include in the layout.
RoomTemplateResource RoomTemplate
The room template.