using System.Linq; using Godot; using Godot.Collections; namespace Cirno.Scripts.Resources; [GlobalClass] public partial class MapsDatabase : Resource { [Export] public Array 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); } }