custom exceptions, methods to create modules and states of specific type from generic ones
This commit is contained in:
@@ -49,8 +49,8 @@ namespace EscapeRoomEngine.Engine.Runtime.Utilities
|
||||
{
|
||||
public bool IsSome() => false;
|
||||
public bool IsNone() => true;
|
||||
public T Expect(string message) => throw new Exception(message);
|
||||
public T Unwrap() => throw new Exception("Tried to unwrap None.");
|
||||
public T Expect(string message) => throw new OptionException(message);
|
||||
public T Unwrap() => throw new OptionException("Tried to unwrap None.");
|
||||
public T UnwrapOr(T def) => def;
|
||||
public T UnwrapOrElse(Func<T> f) => f();
|
||||
public IOption<T> And(IOption<T> other) => this;
|
||||
|
||||
Reference in New Issue
Block a user