split into multiple assemblies

This commit is contained in:
2022-11-20 12:52:22 +01:00
parent def03954a0
commit 9fdfafc3eb
373 changed files with 380 additions and 119 deletions

View File

@@ -0,0 +1,34 @@
using System.Collections.Generic;
using System.Linq;
using EscapeRoomEngine.Engine.Runtime.Modules;
using EscapeRoomEngine.Engine.Runtime.Utilities;
namespace EscapeRoomEngine.Engine.Runtime.Requirements
{
public abstract class OrientationRequirement : Requirement<Orientation>
{
protected abstract override IEnumerable<Orientation> GenerateCandidates(Module module, Space space);
public static bool TryOrienting(Module module, Space space)
{
var orientationCandidates = Candidates(
Module.EveryOrientation,
module.description.orientationRequirements,
module, space);
Logger.Log($"orientation candidates: {string.Join(",", orientationCandidates.ToList().ConvertAll(c => c.ToString()))}", LogType.RequirementResolution);
if (orientationCandidates.Count > 0)
{
module.orientation = orientationCandidates.RandomElement();
return true;
}
// ReSharper disable once RedundantIfElseBlock
else
{
Logger.Log("Could not find suitable orientation for module", LogType.ModulePlacement);
return false;
}
}
}
}