mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
21 lines
No EOL
484 B
C#
21 lines
No EOL
484 B
C#
using System.Linq;
|
|
using Godot;
|
|
using Godot.Collections;
|
|
|
|
namespace Cirno.Scripts.Resources;
|
|
|
|
[GlobalClass]
|
|
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);
|
|
}
|
|
} |