increase room diversity, improve ui

This commit is contained in:
2023-05-13 13:06:08 +02:00
parent ec094f410f
commit 033989a85e
21 changed files with 736 additions and 83 deletions

View File

@@ -9,6 +9,7 @@ using NaughtyAttributes;
using UnityEngine;
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
using Range = EscapeRoomEngine.Engine.Runtime.Utilities.Range;
namespace EscapeRoomEngine.Engine.Runtime
{
@@ -108,7 +109,7 @@ namespace EscapeRoomEngine.Engine.Runtime
Passage exit;
// choose a puzzle from the plan and remove it from both the plan and later available puzzles (so it is only chosen once)
var puzzle = _plannedPuzzles.PopRandomElement();
var puzzle = Measure.PreferLessPlayed ? _plannedPuzzles.Pop() : _plannedPuzzles.PopRandomElement();
_availablePuzzles.Remove(puzzle);
GameControl.Instance.CurrentPuzzle = puzzle;
@@ -173,6 +174,11 @@ namespace EscapeRoomEngine.Engine.Runtime
_plannedPuzzles.Add(_availablePuzzles[i]);
}
if (Measure.PreferLessPlayed)
{
_plannedPuzzles.Sort((a, b) => Measure.TimesPlayed(a).CompareTo(Measure.TimesPlayed(b)));
}
EstimatedTimeRemaining = Measure.EstimateTime(_plannedPuzzles);
GameControl.Instance.PlannedPuzzles = _plannedPuzzles;
}