diff --git a/csharp/Lib/Units/State.cs b/csharp/Lib/Units/State.cs index 3060186de..63b1c6d7c 100644 --- a/csharp/Lib/Units/State.cs +++ b/csharp/Lib/Units/State.cs @@ -15,12 +15,15 @@ public readonly struct State public State(params String[] values) : this((IReadOnlyList)values){} public State(params State[] states) : this((IReadOnlyList)states.SelectMany(s => s.Values).ToList()){} - public static implicit operator State(String s) => new State(s); - public static implicit operator State(Enum e) => new State(e.ToString()); - public static implicit operator State(Boolean s) => new State(s.ToString()); - public static implicit operator State(List s) => new State((IReadOnlyList)s); + public static implicit operator State(String s) => new(s); + public static implicit operator State(Enum e) => new(e.ToString()); + public static implicit operator State(Boolean s) => new(s.ToString()); + public static implicit operator State(List s) => new((IReadOnlyList)s); + public static implicit operator State(String[] s) => new((IReadOnlyList)s); + public static implicit operator State(List es) => new(es.Select(e => e.ToString()).ToArray()); + public static implicit operator State(Enum[] es) => new(es.Select(e => e.ToString()).ToArray()); - public static State operator |(State left, State right) => new State(left, right); + public static State operator |(State left, State right) => new(left, right); public override String ToString() => String.Join("; ", Values); } \ No newline at end of file