add PreconditionRequirement and RelatedModule requirement

This commit is contained in:
2022-11-20 18:05:50 +01:00
parent 1dcd6e67e1
commit 8ee43d6823
21 changed files with 270 additions and 7 deletions

View File

@@ -81,9 +81,10 @@ namespace EscapeRoomEngine.Engine.Runtime
var exit = new Passage(exitDoor);
// add puzzles
for (var i = 0; i < Utilities.Utilities.RandomInclusive(theme.puzzleCount.x, theme.puzzleCount.y); i++)
var puzzleCount = Utilities.Utilities.RandomInclusive(theme.puzzleCount.x, theme.puzzleCount.y);
for (var i = 0; i < puzzleCount; i++)
{
space.AddModuleWithRequirements(new PuzzleModule(space, theme.puzzleTypes.RandomElement()));
space.AddModuleWithRequirements(Module.CreateModuleByType(space, theme.puzzleTypes.RandomElement()));
}
room.AddSpace(space, exit);