Class TagUtils
Inheritance
System.Object
TagUtils
Assembly: Eco.Gameplay.dll
Syntax
public static class TagUtils : Object
Methods
Declaration
public static bool BlockHasAllTags(Vector3i worldPos, params Tag[] tags)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool BlockHasAllTags(Vector3i worldPos, IEnumerable<Tag> tags)
Parameters
Type |
Name |
Description |
Vector3i |
worldPos |
|
System.Collections.Generic.IEnumerable<Tag> |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
BlockHasAnyTag(Vector3i, Tag[])
Declaration
public static bool BlockHasAnyTag(Vector3i worldPos, params Tag[] tags)
Parameters
Returns
Type |
Description |
System.Boolean |
|
BlockHasAnyTag(Vector3i, IEnumerable<Tag>)
Declaration
public static bool BlockHasAnyTag(Vector3i worldPos, IEnumerable<Tag> tags)
Parameters
Type |
Name |
Description |
Vector3i |
worldPos |
|
System.Collections.Generic.IEnumerable<Tag> |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool BlockHasNoneTags(Vector3i worldPos, params Tag[] tags)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool BlockHasNoneTags(Vector3i worldPos, IEnumerable<Tag> tags)
Parameters
Type |
Name |
Description |
Vector3i |
worldPos |
|
System.Collections.Generic.IEnumerable<Tag> |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
BlockMeetsTagRequirements(Vector3i, IEnumerable<Tag>, IEnumerable<Tag>, IEnumerable<Tag>)
Declaration
public static bool BlockMeetsTagRequirements(Vector3i worldPos, IEnumerable<Tag> hasAny, IEnumerable<Tag> hasAll, IEnumerable<Tag> hasNone)
Parameters
Type |
Name |
Description |
Vector3i |
worldPos |
|
System.Collections.Generic.IEnumerable<Tag> |
hasAny |
|
System.Collections.Generic.IEnumerable<Tag> |
hasAll |
|
System.Collections.Generic.IEnumerable<Tag> |
hasNone |
|
Returns
Type |
Description |
System.Boolean |
|
GetBestTag(IEnumerable<Object>)
Collects tags of entries and tries to find the best match that is present in each of them.
Declaration
public static Tag GetBestTag(this IEnumerable<object> entries)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Object> |
entries |
|
Returns
Declaration
public static bool HasAllTags(this Type type, params Tag[] tags)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Tag[] |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool HasAllTags(this Type type, IEnumerable<Tag> tags)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
System.Collections.Generic.IEnumerable<Tag> |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
HasAnyTag(Type, Tag[])
Declaration
public static bool HasAnyTag(this Type type, params Tag[] tags)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Tag[] |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
HasAnyTag(Type, IEnumerable<Tag>)
Declaration
public static bool HasAnyTag(this Type type, IEnumerable<Tag> tags)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
System.Collections.Generic.IEnumerable<Tag> |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool HasNoneTags(this Type type, params Tag[] tags)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Tag[] |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool HasNoneTags(this Type type, IEnumerable<Tag> tags)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
System.Collections.Generic.IEnumerable<Tag> |
tags |
|
Returns
Type |
Description |
System.Boolean |
|
HasTag(Type, Tag)
Declaration
public static bool HasTag(this Type type, Tag tag)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Tag |
tag |
|
Returns
Type |
Description |
System.Boolean |
|
MeetsTagRequirements(Type, IEnumerable<Tag>, IEnumerable<Tag>, IEnumerable<Tag>)
Checks if given type meets all tag requirements. Pass null to requirement to ignore it.
Declaration
public static bool MeetsTagRequirements(this Type type, IEnumerable<Tag> hasAny, IEnumerable<Tag> hasAll, IEnumerable<Tag> hasNone)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
System.Collections.Generic.IEnumerable<Tag> |
hasAny |
|
System.Collections.Generic.IEnumerable<Tag> |
hasAll |
|
System.Collections.Generic.IEnumerable<Tag> |
hasNone |
|
Returns
Type |
Description |
System.Boolean |
|
TagDisplayNames(Object, Boolean)
Declaration
public static IEnumerable<LocString> TagDisplayNames(this object obj, bool includeHidden = true)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
System.Boolean |
includeHidden |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<LocString> |
|
TaggedItems(Tag)
Declaration
public static IEnumerable<Item> TaggedItems(this Tag tag)
Parameters
Type |
Name |
Description |
Tag |
tag |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Item> |
|
TaggedTypes(Tag)
Declaration
public static IEnumerable<Type> TaggedTypes(this Tag tag)
Parameters
Type |
Name |
Description |
Tag |
tag |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
TagNames(Object, Boolean)
Returns string collection of object's tags.
Declaration
public static IEnumerable<string> TagNames(this object obj, bool includeHidden = true)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
System.Boolean |
includeHidden |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
Declaration
public static IEnumerable<Tag> Tags(this Item item)
Parameters
Type |
Name |
Description |
Item |
item |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Tag> |
|
Declaration
public static IEnumerable<Tag> Tags(this Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Tag> |
|
TrySatisfySpecs(IEnumerable<IStack>, Item, Int32)
Given a list of specifications (a number of tags or items), modify it and return how many are satisfied by the passed in item and quantity.
Declaration
public static int TrySatisfySpecs(this IEnumerable<IStack> specStacks, Item item, int quantity)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IStack> |
specStacks |
|
Item |
item |
|
System.Int32 |
quantity |
|
Returns
Type |
Description |
System.Int32 |
|