custom exceptions, methods to create modules and states of specific type from generic ones

This commit is contained in:
2022-11-20 22:17:32 +01:00
parent 8ee43d6823
commit b0df3f303a
9 changed files with 92 additions and 54 deletions

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EscapeRoomEngine.Engine.Runtime.Modules;
@@ -77,7 +76,7 @@ namespace EscapeRoomEngine.Engine.Runtime
// add exit
var exitDoor = new DoorModule(space, theme.exitDoorTypes.RandomElement());
if (!space.AddModuleWithRequirements(exitDoor))
throw new Exception("Could not satisfy requirements for exit door.");
throw new EngineException("Could not satisfy requirements for exit door.");
var exit = new Passage(exitDoor);
// add puzzles