Class WeightedOptionsArray
- Namespace
- KSP.Modding.Variety
- Assembly
- Assembly-CSharp.dll
public class WeightedOptionsArray
- Inheritance
-
WeightedOptionsArray
- Inherited Members
-
- Extension Methods
-
Constructors
WeightedOptionsArray(JSONFriendlyWeightedOptionArray)
public WeightedOptionsArray(JSONFriendlyWeightedOptionArray JSONMiddleData)
Parameters
JSONMiddleData JSONFriendlyWeightedOptionArray
Fields
Name
Field Value
- string
Properties
OptionType
public Type OptionType { get; }
Property Value
- Type
WeightedOptions
public WeightedOptionsArray.WeightedOption[] WeightedOptions { get; }
Property Value
- WeightedOption[]
Methods
BuildWeightedOptionsArray(Dictionary<string, int>)
public void BuildWeightedOptionsArray(Dictionary<string, int> dictionaryFromJSON)
Parameters
dictionaryFromJSON Dictionary<string, int>
GetRandomWeightedOption(ref MPRandom)
public object GetRandomWeightedOption(ref MPRandom externalRandomizer)
Parameters
externalRandomizer MPRandom
Returns
- object
GetRandomWeightedOption(ref MPRandom, IList<WeightedOption>, uint)
public object GetRandomWeightedOption(ref MPRandom externalRandomizer, IList<WeightedOptionsArray.WeightedOption> weightedOptions, uint totalCumulativeWeight)
Parameters
externalRandomizer MPRandom
weightedOptions IList<WeightedOptionsArray.WeightedOption>
totalCumulativeWeight uint
Returns
- object
IsValidList()
public bool IsValidList()
Returns
- bool
TryGetFilteredWeightedOption(ref MPRandom, string, out object)
public bool TryGetFilteredWeightedOption(ref MPRandom externalRandomizer, string onlyIncludeIfContainsThisSubString, out object result)
Parameters
externalRandomizer MPRandom
onlyIncludeIfContainsThisSubString string
result object
Returns
- bool