Package org.lazywizard.console
Class CommandUtils
-
- All Implemented Interfaces:
public class CommandUtils
-
-
Method Summary
Modifier and Type Method Description static StringfindBestStringMatch(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 StringbestMatch(List<Map.Entry<String, Float>> toSearch)static booleanisInteger(String arg)static booleanisLong(String arg)static booleanisFloat(String arg)static booleanisDouble(String arg)static Stringformat(int toFormat)static Stringformat(float toFormat)static Stringindent(String message, int indentation, String existingIndentation)Indents and word-wraps a String to fit within the console's overlay. static Stringindent(String message, int indentation)Indents and word-wraps a String to fit within the console's overlay. static FactionAPIfindBestFactionMatch(String name)static MarketAPIfindBestMarketMatch(String name)static MarketConditionSpecAPIfindBestMarketConditionMatch(String name)static IndustrySpecAPIfindBestIndustryMatch(String name)static LocationAPIfindBestLocationMatch(String name)static StarSystemAPIfindBestSystemMatch(String name)static SectorEntityTokenfindBestTokenMatch(String name, Collection<SectorEntityToken> toSearch)static OfficerDataAPIfindBestOfficerMatch(String name, CampaignFleetAPI fleet)static List<SectorEntityToken>getEntitiesWithTags(LocationAPI location, Array<String> tags)static SectorEntityTokenfindTokenInLocation(String toFind, LocationAPI location)static StringgetFactionName(FactionAPI faction)static CargoAPIgetUsableCargo(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)
- Returns:
A Map.Entry whose key contains the closest match to
id(or null if no match was found), and whose value contains the Collection the match came from, if one was found.
-
findBestStringMatchWithSimularity
static Map.Entry<String, Double> findBestStringMatchWithSimularity(String id, Collection<String> toSearch)
-
indent
static String indent(String message, int indentation, 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 indentmessagewith.existingIndentation- Any existing indentation, for complicated messages that are indented multiple times.- Returns:
message, indented and word-wrapped to fit within the console overlay.- Since:
3.0
-
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 indentmessagewith.- Returns:
message, indented and word-wrapped to fit within the console overlay.- Since:
3.0
-
findBestFactionMatch
static FactionAPI findBestFactionMatch(String name)
-
findBestMarketMatch
static MarketAPI findBestMarketMatch(String name)
-
findBestMarketConditionMatch
static MarketConditionSpecAPI findBestMarketConditionMatch(String name)
-
findBestIndustryMatch
static IndustrySpecAPI findBestIndustryMatch(String name)
-
findBestLocationMatch
static LocationAPI findBestLocationMatch(String name)
-
findBestSystemMatch
static StarSystemAPI findBestSystemMatch(String name)
-
findBestTokenMatch
static SectorEntityToken findBestTokenMatch(String name, Collection<SectorEntityToken> toSearch)
-
findBestOfficerMatch
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)
-
-
-
-