Level Teleporters

This commit is contained in:
Marco 2025-09-10 16:16:05 +02:00
commit 7a8bb4311b
26 changed files with 581 additions and 410 deletions

View file

@ -6,9 +6,19 @@ namespace Cirno.Scripts.Resources;
public partial class MapResource : Resource
{
[Export] public int LevelId { get; set; }
[Export] public StringName MapId { get; set; }
[Export] public StringName MapName { get; set; }
[Export] public StringName MapDescription { get; set; }
[Export] public StringName ScenePath { get; set; }
[Export] public StringName NextMap { get; set; }
[Export] public bool WeaponsAllowed { get; set; }
[Export] public MapStartDataResource StartData { get; set; }
[Export] public MapType MapType { get; set; }
}
public enum MapType
{
Map2D,
Map3D
}

View file

@ -1,4 +1,5 @@
using Godot;
using System.Linq;
using Godot;
using Godot.Collections;
namespace Cirno.Scripts.Resources;
@ -7,4 +8,14 @@ namespace Cirno.Scripts.Resources;
public partial class MapsDatabase : Resource
{
[Export] public Array<MapResource> Maps { get; set; }
public MapResource FindMap(StringName mapId)
{
return Maps.FirstOrDefault(x => x.MapId is not null && x.MapId.Equals(mapId));
}
public MapResource FindNextMap(StringName mapId)
{
return FindMap(FindMap(mapId).NextMap);
}
}