puzzle module framework, puzzle a ball module

This commit is contained in:
2022-11-18 02:10:05 +01:00
parent bd0934636f
commit 99e0452379
90 changed files with 4799 additions and 51 deletions

View File

@@ -34,22 +34,22 @@ namespace Escape_Room_Engine.Engine.Scripts
{
Logger.Log($"Skipping {this}...", LogType.PuzzleFlow);
_puzzles.ForEach(puzzle => puzzle.State.Solve());
_puzzles.ForEach(puzzle => puzzle.PuzzleState.Solve());
}
internal void AddPuzzle(PuzzleModule puzzle)
{
_puzzles.Add(puzzle);
puzzle.State.PuzzleEvent += OnPuzzleEvent;
puzzle.PuzzleState.PuzzleEvent += OnPuzzleEvent;
}
private void OnPuzzleEvent(PuzzleModule puzzle, PuzzleEventType type)
{
if (type == PuzzleEventType.Solved)
{
if (_puzzles.All(p => p.State.Solved))
if (_puzzles.All(p => p.PuzzleState.Solved))
{
exit.fromOut.State.Unlock();
exit.fromOut.DoorState.Unlock();
}
}
}
@@ -57,7 +57,7 @@ namespace Escape_Room_Engine.Engine.Scripts
internal void AddDoor(DoorModule door)
{
_doors.Add(door);
door.State.DoorEvent += OnDoorEvent;
door.DoorState.DoorEvent += OnDoorEvent;
}
private void OnDoorEvent(DoorModule door, DoorEventType type)