Overhaul game state logic to support gameplay loop
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
@@ -63,5 +64,9 @@ public partial class BossRoomA : Node3D, IBossRoom
|
||||
public void ExitReached()
|
||||
=> Game.FloorExitReached();
|
||||
|
||||
private void Exit_AreaEntered(Area3D area) => ExitReached();
|
||||
private void Exit_AreaEntered(Area3D area)
|
||||
{
|
||||
if (area.GetOwner() is IPlayer)
|
||||
ExitReached();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
@@ -21,5 +22,9 @@ public partial class ExitRoom : DungeonRoom
|
||||
public void ExitReached()
|
||||
=> Game.FloorExitReached();
|
||||
|
||||
private void Exit_AreaEntered(Area3D area) => ExitReached();
|
||||
private void Exit_AreaEntered(Area3D area)
|
||||
{
|
||||
if (area.GetOwner() is IPlayer)
|
||||
ExitReached();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Immutable;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
@@ -22,12 +23,16 @@ public partial class Floor0 : Node3D, IDungeonFloor
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Show();
|
||||
Exit.AreaEntered += Exit_AreaEntered;
|
||||
FloorIsLoaded = true;
|
||||
Show();
|
||||
Exit.AreaEntered += Exit_AreaEntered;
|
||||
FloorIsLoaded = true;
|
||||
}
|
||||
|
||||
private void Exit_AreaEntered(Area3D area) => ExitReached();
|
||||
private void Exit_AreaEntered(Area3D area)
|
||||
{
|
||||
if (area.GetOwner() is IPlayer)
|
||||
ExitReached();
|
||||
}
|
||||
|
||||
public void ExitReached() => Game.FloorExitReached();
|
||||
public void InitializeDungeon() { return; }
|
||||
|
||||
Reference in New Issue
Block a user