Kerbal Space Program
1.12.4
|
String utilites is soon to be deprecated due to the use of lingoona. More...
Static Public Member Functions | |
static string | AlphaNumericDesignation (int seed) |
Assembles a random designation, used for several name generators. More... | |
static string | AppropriatePronoun (PronounCasing casing, GrammaticalGender gender, bool postFix=false) |
Picks an appropriate pronoun given a pronoun case and a gender. More... | |
static float | CalculateReadDuration (string s) |
Calculates how long a message of any length should display using average reading speeds. More... | |
static string | CardinalDirectionBetween (double originLatitude, double originLongitude, double destinationLatitude, double destinationLongitude) |
Describes the cardinal direction from one point to another. More... | |
static List< string > | FormattedCurrencies (float funds, float science, float reputation, bool symbols=false, bool verbose=false, TransactionReasons reason=TransactionReasons.None, CurrencyModifierQuery.TextStyling style=CurrencyModifierQuery.TextStyling.OnGUI) |
Produces a list of formatted strings representing each currency. More... | |
static string | GenerateSiteName (int seed, CelestialBody body, bool landLocked, bool allowNamed=true) |
Generates a random site name for a contract. More... | |
static string | IntegerToGreek (int x) |
Converts numbers into greek letters. More... | |
static bool | IsVowel (char c) |
Determines if a character is a vowel. More... | |
static GrammaticalGender | KerbalGrammaticalGender (ProtoCrewMember pcm) |
Returns the grammatical gender for a ProtoCrewMember. More... | |
static void | LoadSiteGenerationInfo () |
This section is mostly site name generation stuff. The lists contents have been moved to an external file, just as the kerbal names. You can find the files at Resources/TextAssets/SiteNameGenerator. This change will allow localization to decide which file is appropiate for the displayed language. The string utlities are loaded in the "Init" method on Localization.cs More... | |
static string | NamedSitePrefix (KSPRandom generator=null) |
Generates a waypoint site name prefix. More... | |
static string | NamedSiteSuffix (CelestialBody body, bool landLocked, System.Random generator=null) |
Generates a waypoint site name suffix. More... | |
static string | PackDelimitedString< T > (List< T > items, char delimiter= '|') |
Packs a list of anything into a delimited string. More... | |
static string | PossessiveString (string thing) |
Converts a noun into a possessive noun properly. More... | |
static string | ShortKerbalName (string fullKerbalName) |
Strips "Kerman" off of a full kerbal name. More... | |
static string | ShortName (string verbose) |
Chooses the final token in a string delimited by periods. More... | |
static string | SpecificVesselName (Contract contract) |
Gets the current name of a vessel tracked by a contextual contract. More... | |
static string | ThisThisAndThat (List< string > stringList, string connector="#autoLOC_6002373", string conjugation="#autoLOC_6002374") |
Takes a list of strings and turns them into a readable list. More... | |
static string | TitleCase (string str) |
Converts a string into "Title Case". More... | |
static bool | TryParseGeneric< T > (string input, out T value) |
Tries to parse anything from a string. More... | |
static KeyValuePair< T1, T2 > | UnpackDelimitedPair< T1, T2 > (string items, char delimiter= '|') |
Unpacks a delimited pair of strings into a pair of two anythings. More... | |
static List< T > | UnpackDelimitedString< T > (string items, char delimiter= '|') |
Unpacks a delimited list of strings into a list of anything. More... | |
static string | ValueAndUnits (RecordTrackType trackType, double trackValue) |
Produces a human readable string of a number and unit of measurement for a record track. More... | |
String utilites is soon to be deprecated due to the use of lingoona.
|
inlinestatic |
Assembles a random designation, used for several name generators.
seed | The seed. |
|
inlinestatic |
Picks an appropriate pronoun given a pronoun case and a gender.
casing | The pronoun case. |
gender | The gender. |
postFix | If a possessive pronoun is postfixing the subject. |
|
inlinestatic |
Calculates how long a message of any length should display using average reading speeds.
s | The string. |
|
inlinestatic |
Describes the cardinal direction from one point to another.
originLatitude | Latitude of the origin point. |
originLongitude | Longitude of the origin point. |
destinationLatitude | Latitude of the destination point. |
destinationLongitude | Longitude of the destination point. |
|
inlinestatic |
Produces a list of formatted strings representing each currency.
funds | The amount of funds before strategies. |
science | The amount of science before strategies. |
reputation | The amount of reputation before strategies. |
symbols | Whether to identify the currencies with symbols or words. |
verbose | If the strategy deltas should be shown or quietly added in. |
reason | An optional transaction reason if using a strategy. |
style | An optional style to determine coloration. |
< These strings can be arranged many ways, so rather than try to accommodate every possibility, we'll return a list to be used however is needed.
< We are comparing strings to avoid confusing situations where the amount is not technically zero, but it's so small that it is being displayed as zero anyway.
|
inlinestatic |
Generates a random site name for a contract.
seed | The random seed. |
body | The celestial body. |
landLocked | Exclude oceanic names. |
|
inlinestatic |
Converts numbers into greek letters.
x | The number. |
|
inlinestatic |
Determines if a character is a vowel.
c | The character. |
|
inlinestatic |
Returns the grammatical gender for a ProtoCrewMember.
pcm | The ProtoCrewMember. |
|
inlinestatic |
This section is mostly site name generation stuff. The lists contents have been moved to an external file, just as the kerbal names. You can find the files at Resources/TextAssets/SiteNameGenerator. This change will allow localization to decide which file is appropiate for the displayed language. The string utlities are loaded in the "Init" method on Localization.cs
Used to load the site generator language info into the game.
|
inlinestatic |
Generates a waypoint site name prefix.
generator | An optional random generator to use. |
< About half the time, just return a random kerbal name, for variety.
|
inlinestatic |
Generates a waypoint site name suffix.
generator | An optional random generator to use. |
|
inlinestatic |
Packs a list of anything into a delimited string.
T | The type to convert from. |
items | The list of items to convert. |
delimiter | Optional custom delimiter. |
|
inlinestatic |
Converts a noun into a possessive noun properly.
thing | The noun. |
|
inlinestatic |
Strips "Kerman" off of a full kerbal name.
fullKerbalName | Full name of the kerbal. |
|
inlinestatic |
Chooses the final token in a string delimited by periods.
verbose | The long string. |
|
inlinestatic |
Gets the current name of a vessel tracked by a contextual contract.
contract | The contextual contract. |
|
inlinestatic |
Takes a list of strings and turns them into a readable list.
stringList | The list of strings. |
|
inlinestatic |
Converts a string into "Title Case".
str | The string. |
|
inlinestatic |
Tries to parse anything from a string.
T | The resultant type. |
input | The string to parse. |
value | The thing to parse to. |
|
inlinestatic |
Unpacks a delimited pair of strings into a pair of two anythings.
T1 | The type to convert the first key to. |
T2 | The type to convert the second value to. |
items | The delimited string. |
delimiter | Optional custom delimiter. |
|
inlinestatic |
Unpacks a delimited list of strings into a list of anything.
T | The type to convert the strings to. |
items | The delimited string. |
delimiter | Optional custom delimiter. |
|
inlinestatic |
Produces a human readable string of a number and unit of measurement for a record track.
trackType | Type of the record track. |
trackValue | The track value. |