end terminal placement

This commit is contained in:
2023-05-15 20:52:27 +02:00
parent bbdae70907
commit 16a69d2fec
12 changed files with 76 additions and 13 deletions

View File

@@ -189,8 +189,14 @@ namespace EscapeRoomEngine.Engine.Runtime
private void GenerateEndSpace(Room room, Passage entrance)
{
Logger.Log($"Generating end space...", LogType.RoomGeneration);
room.AddSpace(new Space(room, entrance), null);
var space = new Space(room, entrance);
var endModule = new Module(space, theme.endModule);
if (!space.AddModuleWithRequirements(endModule))
{
throw new EngineException("Could not satisfy requirements for end module.");
}
room.AddSpace(space, null);
}
#endregion