estimate ui
This commit is contained in:
@@ -13,11 +13,11 @@ namespace EscapeRoomEngine.Engine.Runtime
|
||||
{
|
||||
internal Passage entrance, exit;
|
||||
internal GameObject roomObject;
|
||||
internal readonly List<PuzzleModule> puzzles = new();
|
||||
|
||||
internal bool LastRoom => exit == null;
|
||||
|
||||
private readonly List<Space> _spaces = new();
|
||||
private readonly List<PuzzleModule> _puzzles = new();
|
||||
private readonly List<DoorModule> _doors = new();
|
||||
|
||||
internal Room(Passage entrance)
|
||||
@@ -38,8 +38,8 @@ namespace EscapeRoomEngine.Engine.Runtime
|
||||
{
|
||||
Logger.Log($"Skipping {this}...", LogType.PuzzleFlow);
|
||||
|
||||
_puzzles.ForEach(puzzle => puzzle.PuzzleState.Solve());
|
||||
if (_puzzles.Count == 0 && !LastRoom)
|
||||
puzzles.ForEach(puzzle => puzzle.PuzzleState.Solve());
|
||||
if (puzzles.Count == 0 && !LastRoom)
|
||||
{
|
||||
exit.fromOut.DoorState.Unlock();
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace EscapeRoomEngine.Engine.Runtime
|
||||
|
||||
internal void AddPuzzle(PuzzleModule puzzle)
|
||||
{
|
||||
_puzzles.Add(puzzle);
|
||||
puzzles.Add(puzzle);
|
||||
puzzle.PuzzleState.PuzzleEvent += OnPuzzleEvent;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace EscapeRoomEngine.Engine.Runtime
|
||||
{
|
||||
GameControl.Instance.StopGame();
|
||||
}
|
||||
else if (_puzzles.All(p => p.PuzzleState.Solved))
|
||||
else if (puzzles.All(p => p.PuzzleState.Solved))
|
||||
{
|
||||
exit.fromOut.DoorState.Unlock();
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace EscapeRoomEngine.Engine.Runtime
|
||||
break;
|
||||
// start measurements on every puzzle as soon as the player enters the last room
|
||||
case DoorEventType.ExitedFrom when door.Equals(entrance.toIn) && Engine.Instance.CurrentRoom.Contains(this):
|
||||
_puzzles.ForEach(puzzle => Measure.StartMeasuring((PuzzleModuleDescription)puzzle.description));
|
||||
puzzles.ForEach(puzzle => Measure.StartMeasuring((PuzzleModuleDescription)puzzle.description));
|
||||
Engine.Instance.HidePreviousRoom();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user