-
- All Implemented Interfaces:
public class CommandUtils
-
-
Method Summary
Modifier and Type Method Description static String
findBestStringMatch(String id, Collection<String> toSearch)
static Map.Entry<String, Collection<String>>
findBestStringMatch(String id, Array<Collection<String>> sources)
static Map.Entry<String, Double>
findBestStringMatchWithSimularity(String id, Collection<String> toSearch)
static String
bestMatch(List<Map.Entry<String, Float>> toSearch)
static boolean
isInteger(String arg)
static boolean
isLong(String arg)
static boolean
isFloat(String arg)
static boolean
isDouble(String arg)
static String
format(int toFormat)
static String
format(float toFormat)
static String
indent(String message, int indentation, @Nullable() String existingIndentation)
Indents and word-wraps a String to fit within the console's overlay. static String
indent(String message, int indentation)
Indents and word-wraps a String to fit within the console's overlay. static FactionAPI
findBestFactionMatch(String name)
static MarketAPI
findBestMarketMatch(String name)
static MarketConditionSpecAPI
findBestMarketConditionMatch(String name)
static IndustrySpecAPI
findBestIndustryMatch(String name)
static LocationAPI
findBestLocationMatch(String name)
static StarSystemAPI
findBestSystemMatch(String name)
static SectorEntityToken
findBestTokenMatch(String name, Collection<SectorEntityToken> toSearch)
static OfficerDataAPI
findBestOfficerMatch(String name, CampaignFleetAPI fleet)
static List<SectorEntityToken>
getEntitiesWithTags(LocationAPI location, Array<String> tags)
static SectorEntityToken
findTokenInLocation(String toFind, LocationAPI location)
static String
getFactionName(FactionAPI faction)
static CargoAPI
getUsableCargo(SectorEntityToken token)
-
-
Method Detail
-
findBestStringMatch
static String findBestStringMatch(String id, Collection<String> toSearch)
-
findBestStringMatch
static Map.Entry<String, Collection<String>> findBestStringMatch(String id, Array<Collection<String>> sources)
-
findBestStringMatchWithSimularity
static Map.Entry<String, Double> findBestStringMatchWithSimularity(String id, Collection<String> toSearch)
-
indent
static String indent(String message, int indentation, @Nullable() String existingIndentation)
Indents and word-wraps a String to fit within the console's overlay.
- Parameters:
message
- The String to be indented.indentation
- The number of spaces to indentmessage
with.existingIndentation
- Any existing indentation, for complicated messages that are indented multiple times.
-
indent
static String indent(String message, int indentation)
Indents and word-wraps a String to fit within the console's overlay.
- Parameters:
message
- The String to be indented.indentation
- The number of spaces to indentmessage
with.
-
findBestFactionMatch
@Nullable() static FactionAPI findBestFactionMatch(String name)
-
findBestMarketMatch
@Nullable() static MarketAPI findBestMarketMatch(String name)
-
findBestMarketConditionMatch
@Nullable() static MarketConditionSpecAPI findBestMarketConditionMatch(String name)
-
findBestIndustryMatch
@Nullable() static IndustrySpecAPI findBestIndustryMatch(String name)
-
findBestLocationMatch
static LocationAPI findBestLocationMatch(String name)
-
findBestSystemMatch
@Nullable() static StarSystemAPI findBestSystemMatch(String name)
-
findBestTokenMatch
@Nullable() static SectorEntityToken findBestTokenMatch(String name, Collection<SectorEntityToken> toSearch)
-
findBestOfficerMatch
@Nullable() static OfficerDataAPI findBestOfficerMatch(String name, CampaignFleetAPI fleet)
-
getEntitiesWithTags
static List<SectorEntityToken> getEntitiesWithTags(LocationAPI location, Array<String> tags)
-
findTokenInLocation
static SectorEntityToken findTokenInLocation(String toFind, LocationAPI location)
-
getFactionName
static String getFactionName(FactionAPI faction)
-
getUsableCargo
static CargoAPI getUsableCargo(SectorEntityToken token)
-
-
-
-