Sync minimap floor data
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.SaveFileBuilder;
|
||||
using Godot;
|
||||
@@ -24,5 +25,5 @@ public interface IMap : INode3D, IProvide<ISaveChunk<MapData>>
|
||||
|
||||
void InitializeMapData();
|
||||
|
||||
public int CurrentFloorNumber { get; }
|
||||
public AutoProp<int> CurrentFloorNumber { get; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
using Chickensoft.SaveFileBuilder;
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
@@ -35,7 +37,7 @@ public partial class Map : Node3D, IMap
|
||||
|
||||
public IDungeonFloor CurrentFloor { get; private set; }
|
||||
|
||||
public int CurrentFloorNumber { get; private set; } = 0;
|
||||
public AutoProp<int> CurrentFloorNumber { get; private set; } = new AutoProp<int>(0);
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
@@ -63,7 +65,7 @@ public partial class Map : Node3D, IMap
|
||||
FloorScenes = [];
|
||||
foreach (var floor in _floors)
|
||||
FloorScenes.Add(floor.ResourcePath);
|
||||
CurrentFloorNumber = 0;
|
||||
CurrentFloorNumber.OnNext(0);
|
||||
}
|
||||
|
||||
public void LoadMap()
|
||||
@@ -88,7 +90,7 @@ public partial class Map : Node3D, IMap
|
||||
var transform = GetPlayerSpawnPosition();
|
||||
Player.TeleportPlayer(transform);
|
||||
CurrentFloor.FloorIsLoaded = true;
|
||||
CurrentFloorNumber += 1;
|
||||
CurrentFloorNumber.OnNext(CurrentFloorNumber.Value + 1);
|
||||
}
|
||||
|
||||
public IDungeonRoom GetPlayersCurrentRoom()
|
||||
|
||||
Reference in New Issue
Block a user