Class CategoryExtensions
Inheritance
Namespace: Eco.Gameplay.Civics.GameValues.Values
Assembly: Eco.Gameplay.dll
Syntax
public static class CategoryExtensions : Object
Methods
CategoryDescription(CategoryContainment, IEnumerable<String>)
Declaration
public static string CategoryDescription(this CategoryContainment cat, IEnumerable<string> list)
Parameters
Type | Name | Description |
---|---|---|
CategoryContainment | cat | |
System.Collections.Generic.IEnumerable<System.String> | list |
Returns
Type | Description |
---|---|
System.String |
InclusionTest(CategoryContainment)
Declaration
public static bool InclusionTest(this CategoryContainment requirement)
Parameters
Type | Name | Description |
---|---|---|
CategoryContainment | requirement |
Returns
Type | Description |
---|---|
System.Boolean |
RequiresAll(CategoryContainment)
Declaration
public static bool RequiresAll(this CategoryContainment requirement)
Parameters
Type | Name | Description |
---|---|---|
CategoryContainment | requirement |
Returns
Type | Description |
---|---|
System.Boolean |
Test<T>(CategoryContainment, IEnumerable<T>, Func<T, Eval<Boolean>>, LocString, LocString, LocString, LocString, LocString)
Tests if elements from a set are contained in another set using passed function for testing.
Declaration
public static Eval<bool> Test<T>(this CategoryContainment requirement, IEnumerable<T> set, Func<T, Eval<bool>> evalulate, LocString containerName, LocString hasString, LocString notHasString, LocString elementTypeSingular, LocString elementTypePlural)
Parameters
Type | Name | Description |
---|---|---|
CategoryContainment | requirement | |
System.Collections.Generic.IEnumerable<T> | set | Set that will be tested for specified requirements. |
System.Func<T, Eval<System.Boolean>> | evalulate | Function that returns true if passed element of the passed set is contained in the other set. Also returns name. |
LocString | containerName | Name of the set which has to contain or not contain elements of the passed set. Used to create message describing the result. |
LocString | hasString | String used to describe situation when elements are part of a set (like 'are part of'). |
LocString | notHasString | String used to describe situation when elements are not part of a set (like 'are not part of'). |
LocString | elementTypeSingular | Word that describes elements of the set in singular form. Used to create text for link that opens a foldout list if list of elements is too long (like '1 element'). |
LocString | elementTypePlural | Word that describes elements of the set in plural form. Used to create text for link that opens a foldout list if list of elements is too long (like '9 elements'). |
Returns
Type | Description |
---|---|
Eval<System.Boolean> | Eval with value indicating whether the test was passed and message explaining why test was passed or not in format 'containerName hasString/notHasString list-of-elements'. |
Type Parameters
Name | Description |
---|---|
T |
Test<T>(RequiredTrue, IEnumerable<T>, Func<T, Eval<Boolean>>, LocString, LocString, LocString, LocString, LocString)
Tests if passed cases evaluate to boolean value matching defined requirement using passed function for evaluation.
Declaration
public static Eval<bool> Test<T>(this RequiredTrue requirement, IEnumerable<T> cases, Func<T, Eval<bool>> evaluate, LocString containerName, LocString trueString, LocString falseString, LocString elementTypeSingular, LocString elementTypePlural)
Parameters
Type | Name | Description |
---|---|---|
RequiredTrue | requirement | |
System.Collections.Generic.IEnumerable<T> | cases | Cases that will be tested for specified requirements. |
System.Func<T, Eval<System.Boolean>> | evaluate | Function that returns boolean Eval value to which passed case is evaluated, uses Message as name. |
LocString | containerName | Name of the object for which cases are tested. Used to create message describing the result. |
LocString | trueString | String used to describe situation when cases are evaluated to true (like 'are true'). |
LocString | falseString | String used to describe situation when cases are evaluated to false (like 'are false'). |
LocString | elementTypeSingular | Word that describes all cases in singular form. Used to create text for link that opens a foldout list if list of cases is too long (like '1 case'). |
LocString | elementTypePlural | Word that describes all cases in plural form. Used to create text for link that opens a foldout list if list of cases is too long (like '9 cases'). |
Returns
Type | Description |
---|---|
Eval<System.Boolean> | Eval with value indicating whether the test was passed and message explaining why test was passed or not in format 'containerName trueString/falseString list-of-cases'. |
Type Parameters
Name | Description |
---|---|
T |