public class CommandUtils
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
bestMatch(java.util.List<java.util.Map.Entry> toSearch) |
static com.fs.starfarer.api.campaign.FactionAPI |
findBestFactionMatch(java.lang.String name) |
static com.fs.starfarer.api.loading.IndustrySpecAPI |
findBestIndustryMatch(java.lang.String name) |
static com.fs.starfarer.api.campaign.LocationAPI |
findBestLocationMatch(java.lang.String name) |
static com.fs.starfarer.api.characters.MarketConditionSpecAPI |
findBestMarketConditionMatch(java.lang.String name) |
static com.fs.starfarer.api.campaign.econ.MarketAPI |
findBestMarketMatch(java.lang.String name) |
static com.fs.starfarer.api.characters.OfficerDataAPI |
findBestOfficerMatch(java.lang.String name,
com.fs.starfarer.api.campaign.CampaignFleetAPI fleet) |
static java.lang.String |
findBestStringMatch(java.lang.String id,
java.util.Collection<java.lang.String> toSearch) |
static java.util.Map.Entry<java.lang.String,java.util.Collection> |
findBestStringMatch(java.lang.String id,
java.util.Collection... sources) |
static java.util.Map.Entry<java.lang.String,java.lang.Double> |
findBestStringMatchWithSimularity(java.lang.String id,
java.util.Collection<java.lang.String> toSearch) |
static com.fs.starfarer.api.campaign.StarSystemAPI |
findBestSystemMatch(java.lang.String name) |
static com.fs.starfarer.api.campaign.SectorEntityToken |
findBestTokenMatch(java.lang.String name,
java.util.Collection<com.fs.starfarer.api.campaign.SectorEntityToken> toSearch) |
static com.fs.starfarer.api.campaign.SectorEntityToken |
findTokenInLocation(java.lang.String toFind,
com.fs.starfarer.api.campaign.LocationAPI location) |
static java.lang.String |
format(int toFormat) |
static java.lang.String |
format(float toFormat) |
static java.util.List<com.fs.starfarer.api.campaign.SectorEntityToken> |
getEntitiesWithTags(com.fs.starfarer.api.campaign.LocationAPI location,
java.lang.String... tags) |
static java.lang.String |
getFactionName(com.fs.starfarer.api.campaign.FactionAPI faction) |
static com.fs.starfarer.api.campaign.CargoAPI |
getUsableCargo(com.fs.starfarer.api.campaign.SectorEntityToken token) |
static java.lang.String |
indent(java.lang.String message,
int indentation,
java.lang.String existingIndentation)
Indents and word-wraps a
String to fit within the console's overlay. |
static java.lang.String |
indent(java.lang.String message,
int indentation)
Indents and word-wraps a
String to fit within the console's overlay. |
static boolean |
isDouble(java.lang.String arg) |
static boolean |
isFloat(java.lang.String arg) |
static boolean |
isInteger(java.lang.String arg) |
static boolean |
isLong(java.lang.String arg) |
public static java.lang.String findBestStringMatch(java.lang.String id, java.util.Collection<java.lang.String> toSearch)
public static java.util.Map.Entry<java.lang.String,java.util.Collection> findBestStringMatch(java.lang.String id, java.util.Collection... sources)
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.public static java.util.Map.Entry<java.lang.String,java.lang.Double> findBestStringMatchWithSimularity(java.lang.String id, java.util.Collection<java.lang.String> toSearch)
public static java.lang.String bestMatch(java.util.List<java.util.Map.Entry> toSearch)
public static boolean isInteger(java.lang.String arg)
public static boolean isLong(java.lang.String arg)
public static boolean isFloat(java.lang.String arg)
public static boolean isDouble(java.lang.String arg)
public static java.lang.String format(int toFormat)
public static java.lang.String format(float toFormat)
public static java.lang.String indent(java.lang.String message, int indentation, @Nullable java.lang.String existingIndentation)
Indents and word-wraps a String
to fit within the console's overlay.
message
- org.jetbrains.dokka.NodeRenderContent@6b5053cf: The String
to be indented.indentation
- org.jetbrains.dokka.NodeRenderContent@1736124: The number of spaces to indent message
with.existingIndentation
- org.jetbrains.dokka.NodeRenderContent@10e08373: Any existing indentation, for complicated messages that are indented multiple times. Can be null
.message
, indented and word-wrapped to fit within the console overlay.public static java.lang.String indent(java.lang.String message, int indentation)
Indents and word-wraps a String
to fit within the console's overlay.
message
- org.jetbrains.dokka.NodeRenderContent@644578b1: The String
to be indented.indentation
- org.jetbrains.dokka.NodeRenderContent@7e254f5c: The number of spaces to indent message
with.message
, indented and word-wrapped to fit within the console overlay.@Nullable public static com.fs.starfarer.api.campaign.FactionAPI findBestFactionMatch(java.lang.String name)
@Nullable public static com.fs.starfarer.api.campaign.econ.MarketAPI findBestMarketMatch(java.lang.String name)
@Nullable public static com.fs.starfarer.api.characters.MarketConditionSpecAPI findBestMarketConditionMatch(java.lang.String name)
@Nullable public static com.fs.starfarer.api.loading.IndustrySpecAPI findBestIndustryMatch(java.lang.String name)
public static com.fs.starfarer.api.campaign.LocationAPI findBestLocationMatch(java.lang.String name)
@Nullable public static com.fs.starfarer.api.campaign.StarSystemAPI findBestSystemMatch(java.lang.String name)
@Nullable public static com.fs.starfarer.api.campaign.SectorEntityToken findBestTokenMatch(java.lang.String name, java.util.Collection<com.fs.starfarer.api.campaign.SectorEntityToken> toSearch)
@Nullable public static com.fs.starfarer.api.characters.OfficerDataAPI findBestOfficerMatch(java.lang.String name, com.fs.starfarer.api.campaign.CampaignFleetAPI fleet)
public static java.util.List<com.fs.starfarer.api.campaign.SectorEntityToken> getEntitiesWithTags(com.fs.starfarer.api.campaign.LocationAPI location, java.lang.String... tags)
public static com.fs.starfarer.api.campaign.SectorEntityToken findTokenInLocation(java.lang.String toFind, com.fs.starfarer.api.campaign.LocationAPI location)
public static java.lang.String getFactionName(com.fs.starfarer.api.campaign.FactionAPI faction)
public static com.fs.starfarer.api.campaign.CargoAPI getUsableCargo(com.fs.starfarer.api.campaign.SectorEntityToken token)