This commit is contained in:
CortexCore
2023-11-06 01:17:23 +08:00
parent bd40165ade
commit 5446067f91
114 changed files with 2023 additions and 414 deletions

View File

@@ -9,6 +9,7 @@
{
bool Allow { get; set; }
T Value { get; set; }
T IfNotAllow(T value);
}
[System.Serializable]
public class Optional<T> : IOptional<T>
@@ -29,6 +30,11 @@
set=>this.value=value;
}
public T IfNotAllow(T other)
{
return Allow ? Value : other;
}
public void SetValueThenAllow(T newValue)
{
value = newValue;