![]() |
Kerbal Space Program
1.12.4
|
Static Public Member Functions | |
| static bool | CheckTouristRecoveryContractKerbals (string kerbalName) |
| Scans All tourist contracts and recovery contracts for a matching Kerbal Name. Returns True if a match is found, otherwise false. More... | |
| static bool | CoinFlip (System.Random generator=null) |
| Returns a random true/false. More... | |
| static void | CondenseNodeList (ConfigNode node, string valueName, string listName) |
| Takes multiple separate values in a ConfigNode and condenses them into a single delimited node list value. More... | |
| static void | ExpungeKerbal (ProtoCrewMember pcm) |
| Completely erases a kerbal from existence. More... | |
| static void | ExpungeVessel (Vessel v) |
| Completely erases a vessel from existence. More... | |
| static bool | FlightIsReady (bool checkVessel=false, CelestialBody targetBody=null) |
| Performs all the necessary checks to make sure the flight scene is ready to go, and some optional ones. More... | |
| static bool | FlightIsReady (Contract.State currentState, Contract.State targetState, bool checkVessel=false, CelestialBody targetBody=null) |
| Performs all the necessary checks to make sure the flight scene is ready to go, and some optional ones. More... | |
| static uint | HashNumber (uint x) |
| Hashes an unsigned integer into another, unrelated unsigned integer. More... | |
| static void | LoadNode< T > (ConfigNode node, string className, string valueName, ref T value, T defaultValue, bool logging=true) |
| Loads a ConfigNode value, handles logging and recovery if loading fails. More... | |
| static void | LoadNodeList< T > (ConfigNode node, string className, string valueName, ref List< T > list) |
| Loads a list of objects stored in a single ConfigNode value as a delimited string. More... | |
| static void | LoadNodePair< T1, T2 > (ConfigNode node, string className, string valueName, ref KeyValuePair< T1, T2 > pair) |
| Loads a pair of objects stored in a single ConfigNode value as a delimited string. More... | |
| static Texture2D | LoadTexture (string textureName) |
| Simplifies the action of loading a texture. More... | |
| static double | MeasureDeviation (double v1, double v2) |
| Meaures the deviation between two values relative to each other. More... | |
| static double | MeasureDeviationByValue (double v1, double v2, double fullValue) |
| Meaures the deviation between two values relative to a reference value. More... | |
| static void | ProcessSideRequests (Contract contract, ConfigNode contractNode, CelestialBody targetBody, string vesselName, ref float fundsMultiplier, ref float scienceMultiplier, ref float reputationMultiplier, Vessel vessel=null) |
| Adds request parameters to a contract. Affects several contracts and parameters. More... | |
| static Color | RandomColor (int seed=0, float alpha=1.0f, float saturation=1.0f, float brightness=0.5f) |
| Generates a randomized HSV color. More... | |
| static T | RandomSplitChoice< T > (List< List< T >> listOfLists, System.Random generator=null) |
| Chooses a value randomly from several list references without combining them into a larger one. More... | |
| static void | SaveNodeList< T > (ConfigNode node, string listName, List< T > list) |
| Saves a list of objects in a single ConfigNode value as a delimited string. More... | |
| static void | ShuffleList< T > (ref List< T > list, System.Random generator=null) |
| Shuffles a list at random. More... | |
| static int | SuperSeed (Contract c) |
| Creates an excessively unique and unpredictable seed for a contract. More... | |
| static bool | TryConvert< T > (string input, out T value, ref string error) |
| Attempts to convert a string into any given type or enumeration. More... | |
| static PreBuiltCraftDefinition | ValidateLoadCraftNode (string url, string className, bool brokenParts) |
| Will Validate/Load a Craft file located in the file at url in the filesystem. If the Craft is valid it will return a PreBuiltCraftDefinition pre-populated. If the Craft is invalid or fails to load will return Null. More... | |
| static PreBuiltCraftDefinition | ValidateLoadCraftNode (string url, string className, bool brokenParts, bool bypassTechCheck) |
| Will Validate/Load a Craft file located in the file at url in the filesystem. If the Craft is valid it will return a PreBuiltCraftDefinition pre-populated. If the Craft is invalid or fails to load will return Null. More... | |
| static bool | WithinDeviation (double v1, double v2, double deviation) |
| Checks if two values are within a certain percentage of each other. More... | |
| static double | WithinDeviationAccuracy (double v1, double v2, double deviation) |
| Get the accuracy value of two values within a certain percentage of each other. More... | |
| static double | WithinDeviationByReferenceAccuracy (double v1, double v2, double reference, double deviation) |
| Gets the accuracy value of two values within a certain percentage of each other based on a reference value More... | |
| static bool | WithinDeviationByValue (double v1, double v2, double deviation, double fullValue) |
| Checks if two values are within a certain percentage of the reference value. More... | |
Public Attributes | |
| const int | frameSuccessDelay = 5 |
|
inlinestatic |
Scans All tourist contracts and recovery contracts for a matching Kerbal Name. Returns True if a match is found, otherwise false.
| kerbalName | The name to scan for. Best result is to pass in the first name only. |
|
inlinestatic |
Returns a random true/false.
| generator | An optional random generator to use. |
|
inlinestatic |
Takes multiple separate values in a ConfigNode and condenses them into a single delimited node list value.
| node | The node to check. |
| valueName | The name of the values to find and condense. |
| listName | The name of the delimited list to save to the node. |
|
inlinestatic |
Completely erases a kerbal from existence.
| pcm | The ProtoCrewMember. |
< Somewhat nuclear kerbal annihilation process.
< Do not check GetVesselCrew, it basically does the same thing as below.
|
inlinestatic |
Completely erases a vessel from existence.
| v | The vessel. |
|
inlinestatic |
Performs all the necessary checks to make sure the flight scene is ready to go, and some optional ones.
| checkVessel | Optional: Check if vessel is null. |
| targetBody | Optional: Make sure vessel is at a celestial body. |
|
inlinestatic |
Performs all the necessary checks to make sure the flight scene is ready to go, and some optional ones.
| currentState | Current contract state. |
| targetState | Contract state that must be matched. |
| checkVessel | Optional: Check if vessel is null. |
| targetBody | Optional: Make sure vessel is at a celestial body. |
|
inlinestatic |
Hashes an unsigned integer into another, unrelated unsigned integer.
| x | The unsigned integer. |
|
inlinestatic |
Loads a ConfigNode value, handles logging and recovery if loading fails.
| T | The type of the final variable. |
| node | The node to load from. |
| className | Name of the calling class for logs. |
| valueName | Name of the value in the ConfigNode. |
| value | Value to dump into if successful. |
| defaultValue | Default value to recover with if unsuccessful. |
| logging | Optional flag to temporarily disable logging. |
|
inlinestatic |
Loads a list of objects stored in a single ConfigNode value as a delimited string.
| T | The type of the list. |
| node | The node to load from. |
| className | Name of the calling class for logs. |
| valueName | Name of the delimited string in the ConfigNode. |
| list | List to dump into if successful. |
< We don't save empty lists at all to prevent save pollution, so loading can fail quite frequently. We disable logs here for this reason.
|
inlinestatic |
Loads a pair of objects stored in a single ConfigNode value as a delimited string.
| T1 | The type of the key in the pair. |
| T2 | The type of the value in the pair. |
| node | The node to load from. |
| className | Name of the calling class for logs. |
| valueName | Name of the delimited string in the ConfigNode. |
| pair | KeyValuePair to dump into if successful. |
< We don't save empty pairs at all to prevent save pollution, so loading can fail quite frequently. We disable logs here for this reason.
|
inlinestatic |
Simplifies the action of loading a texture.
| textureName | Name of the texture. |
|
inlinestatic |
Meaures the deviation between two values relative to each other.
| v1 | The first value. |
| v2 | The second value. |
|
inlinestatic |
Meaures the deviation between two values relative to a reference value.
| v1 | The first value. |
| v2 | The second value. |
| fullValue | The value that equals 100% deviation |
|
inlinestatic |
Adds request parameters to a contract. Affects several contracts and parameters.
| contract | The contract. |
| contractNode | The contract template configuration node. |
| targetBody | The celestial body of the contract. |
| vesselName | A vessel type description string. |
| fundsMultiplier | Reference to running funds multiplier. |
| scienceMultiplier | Reference to running science multiplier. |
| reputationMultiplier | Reference to running reputation multiplier. |
| vessel | Optional vessel to pass to the part request for contextuals. |
< Crew requests take a bit more digging.
< Crew interest will be based off of an even split of each trait for half the vessel, plus any specialized parts.
|
inlinestatic |
Generates a randomized HSV color.
| seed | The random seed to use. |
| alpha | The alpha of the color. |
| saturation | The saturation of the color. |
| brightness | The brightness of the color. |
|
inlinestatic |
Chooses a value randomly from several list references without combining them into a larger one.
| listOfLists | An List of Lists to choose from. |
| generator | An optional random generator to use. |
< First we want the total count of all the lists, that will be used for a weighted choice.
|
inlinestatic |
Saves a list of objects in a single ConfigNode value as a delimited string.
| T | The type of the list. |
| node | The node to save to. |
| listName | Name of the delimited string in the ConfigNode. |
| list | List to save. |
|
inlinestatic |
Shuffles a list at random.
| T | The type of list. |
| list | The list reference. |
| generator | An optional random generator to use. |
|
inlinestatic |
Creates an excessively unique and unpredictable seed for a contract.
| c | The contract. |
|
inlinestatic |
Attempts to convert a string into any given type or enumeration.
| T | The type of the final variable. |
| input | The input string. |
| value | Value to dump into if successful. |
| error | Error to dump into if unsuccessful. |
|
inlinestatic |
Will Validate/Load a Craft file located in the file at url in the filesystem. If the Craft is valid it will return a PreBuiltCraftDefinition pre-populated. If the Craft is invalid or fails to load will return Null.
| url | The url for the craft file. |
| className | Name of the calling class for logs. |
|
inlinestatic |
Will Validate/Load a Craft file located in the file at url in the filesystem. If the Craft is valid it will return a PreBuiltCraftDefinition pre-populated. If the Craft is invalid or fails to load will return Null.
| url | The url for the craft file. |
| className | Name of the calling class for logs. |
|
inlinestatic |
Checks if two values are within a certain percentage of each other.
| v1 | The first value. |
| v2 | The second value. |
| deviation | The deviation percentage (0->100). |
|
inlinestatic |
Get the accuracy value of two values within a certain percentage of each other.
| v1 | The first value. |
| v2 | The second value. |
| deviation | The deviation percentage. |
|
inlinestatic |
Gets the accuracy value of two values within a certain percentage of each other based on a reference value
| v1 | The first value. |
| v2 | The second value. |
| reference | The difference that equates to 100% |
| deviation | The deviation percentage. |
|
inlinestatic |
Checks if two values are within a certain percentage of the reference value.
| v1 | The first value. |
| v2 | The second value. |
| deviation | The deviation percentage (0->100). |
| fullValue | The value that equals 100% deviation |
| const int FinePrint.Utilities.SystemUtilities.frameSuccessDelay = 5 |
1.8.7