add implicit op for booleans on State

This commit is contained in:
ig 2023-03-01 08:29:36 +01:00
parent 08c747f2ea
commit d91a4654cd
1 changed files with 3 additions and 4 deletions

View File

@ -15,10 +15,9 @@ public readonly struct State
public State(params String[] values) : this((IReadOnlyList<String>)values){}
public State(params State[] states) : this(states.SelectMany(s => s.Values).ToList()){}
public State(Enum e) : this(e.ToString()){}
public static implicit operator State(Enum e) => new State(e);
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 State operator |(State left, State right) => new State(left, right);