Show / Hide Table of Contents

Class CommandsUtil

Inheritance
System.Object
CommandsUtil
Namespace: Eco.Gameplay.Utils
Assembly: Eco.Gameplay.dll
Syntax
public static class CommandsUtil : Object

Methods

CheckPlayerOnline(User, User)

Check if a player is online before applying action and tell if not

Declaration
public static bool CheckPlayerOnline(User user, User targetUser)
Parameters
Type Name Description
User user
User targetUser
Returns
Type Description
System.Boolean

ClosestMatchingEntity<T>(IChatClient, String, IReadOnlyList<T>, Func<T, String>, Func<T, LocString>, Predicate<T>)

Returns closest matching entities by entityName from entityList.

Declaration
public static T ClosestMatchingEntity<T>(IChatClient chatClient, string entityName, IReadOnlyList<T> entityList, Func<T, string> getName, Func<T, LocString> getDisplayName, Predicate<T> filter = null)
Parameters
Type Name Description
IChatClient chatClient
System.String entityName
System.Collections.Generic.IReadOnlyList<T> entityList
System.Func<T, System.String> getName
System.Func<T, LocString> getDisplayName
System.Predicate<T> filter
Returns
Type Description
T
Type Parameters
Name Description
T

ClosestMatchingItem<T>(IChatClient, String)

Get a matching item of the given type. If null is passed, get a random one.

Declaration
public static T ClosestMatchingItem<T>(IChatClient player, string entityName)
    where T : Item
Parameters
Type Name Description
IChatClient player
System.String entityName
Returns
Type Description
T
Type Parameters
Name Description
T

CollectClosestMatchingEntries<T>(String, IReadOnlyList<T>, Func<T, String>, Func<T, LocString>, Predicate<T>, Boolean)

Collects closest matching entries by entityName from entityList. If 'preferExactMatch' is set, return exact match if it exists instead of list.

Declaration
public static List<T> CollectClosestMatchingEntries<T>(string entityName, IReadOnlyList<T> entityList, Func<T, string> getName, Func<T, LocString> getDisplayName, Predicate<T> filter = null, bool preferExactMatch = true)
Parameters
Type Name Description
System.String entityName
System.Collections.Generic.IReadOnlyList<T> entityList
System.Func<T, System.String> getName
System.Func<T, LocString> getDisplayName
System.Predicate<T> filter
System.Boolean preferExactMatch
Returns
Type Description
System.Collections.Generic.List<T>
Type Parameters
Name Description
T

ItemsWithComponent(Type[])

Declaration
public static List<WorldObjectItem> ItemsWithComponent(params Type[] args)
Parameters
Type Name Description
System.Type[] args
Returns
Type Description
System.Collections.Generic.List<WorldObjectItem>
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾