Unstable v0.19.5.0

This commit is contained in:
Juan Pablo Arce
2022-09-14 12:47:17 -03:00
parent 3f2c843247
commit 1fd2a51bbb
158 changed files with 5702 additions and 4813 deletions
@@ -16,18 +16,18 @@ namespace Barotrauma
public bool IsNone() => this is None<T>;
public bool IsSome() => this is Some<T>;
public bool TryUnwrap(out T outValue)
public bool TryUnwrap(out T outValue) => TryUnwrap<T>(out outValue);
public bool TryUnwrap<T1>(out T1 outValue) where T1 : T
{
switch (this)
{
case Some<T> { Value: var value }:
case Some<T> { Value: T1 value }:
outValue = value;
return true;
case None<T> _:
default:
outValue = default!;
return false;
default:
throw new ArgumentOutOfRangeException();
}
}