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,47 @@
using System;
using UnityEngine;
namespace EscapeRoomEngine.Engine.Runtime.Modules
{
public enum DoorType
{
Entrance = ModuleType.DoorEntrance, Exit = ModuleType.DoorExit
}
[Serializable]
public class DoorModule : Module
{
public bool IsEntrance => IsType((ModuleType)DoorType.Entrance);
public bool IsExit => IsType((ModuleType)DoorType.Exit);
internal DoorState DoorState
{
get
{
if (State is DoorState doorState)
{
return doorState;
}
throw new Exception("DoorModule must contain a DoorState");
}
}
internal DoorModule(Space space, DoorModuleDescription description) : base(space, description)
{
srDimensions.Size = Vector2Int.one; // door always has size 1x1
}
internal override void InstantiateModule(Transform parent)
{
base.InstantiateModule(parent);
space.room.AddDoor(this);
}
public override string ToString()
{
return $"{(IsEntrance ? "Entrance" : IsExit ? "Exit" : "Unknown")} door";
}
}
}