mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Level Teleporters
This commit is contained in:
parent
5e357e1a96
commit
7a8bb4311b
26 changed files with 581 additions and 410 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue