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

@@ -0,0 +1,21 @@
using System;
namespace EscapeRoomEngine.Engine.Runtime.Utilities
{
public class EngineException : Exception
{
public EngineException(string message) : base($"<b>[EngineException]</b> {message}") {}
}
public class WrongTypeException : EngineException
{
public WrongTypeException(Type expected, Type found, Type baseType) : base($"Wrong type of {baseType} ({found} instead of {expected})") {}
public WrongTypeException(string message) : base(message) {}
}
public class OptionException : Exception
{
public OptionException(string message) : base(message) {}
}
}