Class Statics.SwitchSyntax.Condition<T>
Represents the result of a conditional expression inside Switch syntax.
Inheritance
System.Object
Statics.SwitchSyntax.Condition<T>
Namespace: Towel
Assembly: Towel.dll
Syntax
public abstract class Condition<T> : object
Type Parameters
Name | Description |
---|---|
T | The generic type of the Switch condition for equality checks. |
Methods
| Improve this Doc View SourceResolve(T)
Resolves the condition to a bool.
Declaration
public abstract bool Resolve(T b)
Parameters
Type | Name | Description |
---|---|---|
T | b | The right value to compare this condition to. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the condition. |
Operators
| Improve this Doc View SourceImplicit(T to Statics.SwitchSyntax.Condition<T>)
Casts a T
to a bool using an equality check.
Declaration
public static implicit operator Statics.SwitchSyntax.Condition<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value this condition will compare with. |
Returns
Type | Description |
---|---|
Statics.SwitchSyntax.Condition<T> |
Implicit(Boolean to Statics.SwitchSyntax.Condition<T>)
Uses the bool as the condition result.
Declaration
public static implicit operator Statics.SwitchSyntax.Condition<T>(bool result)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | result | The |
Returns
Type | Description |
---|---|
Statics.SwitchSyntax.Condition<T> |
Implicit(Statics.SwitchSyntax.Keyword to Statics.SwitchSyntax.Condition<T>)
Converts a keyword to a condition result (for "Default" case).
Declaration
public static implicit operator Statics.SwitchSyntax.Condition<T>(Statics.SwitchSyntax.Keyword keyword)
Parameters
Type | Name | Description |
---|---|---|
Statics.SwitchSyntax.Keyword | keyword |
Returns
Type | Description |
---|---|
Statics.SwitchSyntax.Condition<T> |