Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Contracts.ContractSystem Class Reference
Inheritance diagram for Contracts.ContractSystem:
ScenarioModule IConfigNode

Public Member Functions

bool AnyCompletedContracts< T > (Func< T, bool > where=null)
 
bool AnyCurrentActiveContracts< T > (Func< T, bool > where=null)
 
bool AnyCurrentContracts< T > (Func< T, bool > where=null)
 
void ClearContractsCurrent ()
 
void ClearContractsFinished ()
 
int CountContracts (Contract.ContractPrestige difficulty)
 
Contract GenerateContract (ref int seed, Contract.ContractPrestige difficulty)
 
Contract GenerateContract (int seed, Contract.ContractPrestige difficulty, System.Type contractType=null)
 
bool GenerateContracts (ref int seed, Contract.ContractPrestige difficulty, int count)
 
void GenerateMandatoryContracts ()
 
int GetActiveContractCount ()
 
T[] GetCompletedContracts< T > (Func< T, bool > where=null)
 
Contract GetContractByGuid (Guid guid)
 
T[] GetCurrentActiveContracts< T > (Func< T, bool > where=null)
 
T[] GetCurrentContracts< T > (Func< T, bool > where=null)
 
bool HasCompletedContract (System.Type type)
 
override void OnAwake ()
 
override void OnLoad (ConfigNode gameNode)
 
override void OnSave (ConfigNode gameNode)
 
void RebuildContracts ()
 
bool WithdrawSurplusContracts (Contract.ContractPrestige level, int maxAllowed)
 
- Public Member Functions inherited from ScenarioModule
void Load (ConfigNode node)
 
void Save (ConfigNode node)
 

Static Public Member Functions

static void AdjustWeight (string name, Contract contract)
 
static void GetContractCounts (float rep, int avgContracts, out int tier1, out int tier2, out int tier3)
 
static System.Type GetContractType (string typeName)
 
static System.Type GetParameterType (string typeName)
 
static System.Type GetPredicateType (string typeName)
 
static void ResetWeights ()
 
static void WeightAdjustment (string name, int delta, bool ignoreLimits=false)
 
static void WeightAssignment (string name, int amount, bool ignoreLimits=false)
 
static CelestialBody WeightedBodyChoice (IList< CelestialBody > bodies, System.Random generator=null)
 
static Type WeightedContractChoice ()
 

Static Public Attributes

static List< System.Type > ContractTypes = null
 
static Dictionary< string, int > ContractWeights = null
 
static int generateContractIterations = 50
 
static bool loaded
 Is set to true once the contract system has completed loading its contracts. More...
 
static List< System.Type > MandatoryTypes = null
 
static List< System.Type > ParameterTypes = null
 
static List< System.Type > PredicateTypes = null
 

Properties

List< ContractContracts [get]
 
List< ContractContractsFinished [get]
 
static ContractSystem Instance [get, set]
 
- Properties inherited from ScenarioModule
int ClassID [get]
 
string ClassName [get]
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 

Additional Inherited Members

- Public Attributes inherited from ScenarioModule
ScenarioRunner runner
 
ProtoScenarioModule snapshot
 
List< GameScenestargetScenes
 

Member Function Documentation

static void Contracts.ContractSystem.AdjustWeight ( string  name,
Contract  contract 
)
inlinestatic
bool Contracts.ContractSystem.AnyCompletedContracts< T > ( Func< T, bool >  where = null)
inline
Type Constraints
T :Contract 
bool Contracts.ContractSystem.AnyCurrentActiveContracts< T > ( Func< T, bool >  where = null)
inline
Type Constraints
T :Contract 
bool Contracts.ContractSystem.AnyCurrentContracts< T > ( Func< T, bool >  where = null)
inline
Type Constraints
T :Contract 
void Contracts.ContractSystem.ClearContractsCurrent ( )
inline
void Contracts.ContractSystem.ClearContractsFinished ( )
inline
int Contracts.ContractSystem.CountContracts ( Contract.ContractPrestige  difficulty)
inline
Contract Contracts.ContractSystem.GenerateContract ( ref int  seed,
Contract.ContractPrestige  difficulty 
)
inline

< generate a contract

< something happened in contract generation, continue

< test to see if contract ID already exists in the existing active contracts

< test to see if contract ID already exists in the finished contracts, try a countback, if so null it and try again

Contract Contracts.ContractSystem.GenerateContract ( int  seed,
Contract.ContractPrestige  difficulty,
System.Type  contractType = null 
)
inline

< pick a random contract type

< generate a contract

bool Contracts.ContractSystem.GenerateContracts ( ref int  seed,
Contract.ContractPrestige  difficulty,
int  count 
)
inline
void Contracts.ContractSystem.GenerateMandatoryContracts ( )
inline
int Contracts.ContractSystem.GetActiveContractCount ( )
inline
T [] Contracts.ContractSystem.GetCompletedContracts< T > ( Func< T, bool >  where = null)
inline
Type Constraints
T :Contract 
Contract Contracts.ContractSystem.GetContractByGuid ( Guid  guid)
inline
static void Contracts.ContractSystem.GetContractCounts ( float  rep,
int  avgContracts,
out int  tier1,
out int  tier2,
out int  tier3 
)
inlinestatic
static System.Type Contracts.ContractSystem.GetContractType ( string  typeName)
inlinestatic
T [] Contracts.ContractSystem.GetCurrentActiveContracts< T > ( Func< T, bool >  where = null)
inline
Type Constraints
T :Contract 
T [] Contracts.ContractSystem.GetCurrentContracts< T > ( Func< T, bool >  where = null)
inline
Type Constraints
T :Contract 
static System.Type Contracts.ContractSystem.GetParameterType ( string  typeName)
inlinestatic
static System.Type Contracts.ContractSystem.GetPredicateType ( string  typeName)
inlinestatic
bool Contracts.ContractSystem.HasCompletedContract ( System.Type  type)
inline
override void Contracts.ContractSystem.OnAwake ( )
inlinevirtual

Reimplemented from ScenarioModule.

override void Contracts.ContractSystem.OnLoad ( ConfigNode  gameNode)
inlinevirtual

Reimplemented from ScenarioModule.

override void Contracts.ContractSystem.OnSave ( ConfigNode  gameNode)
inlinevirtual

Reimplemented from ScenarioModule.

void Contracts.ContractSystem.RebuildContracts ( )
inline
static void Contracts.ContractSystem.ResetWeights ( )
inlinestatic
static void Contracts.ContractSystem.WeightAdjustment ( string  name,
int  delta,
bool  ignoreLimits = false 
)
inlinestatic
static void Contracts.ContractSystem.WeightAssignment ( string  name,
int  amount,
bool  ignoreLimits = false 
)
inlinestatic
static CelestialBody Contracts.ContractSystem.WeightedBodyChoice ( IList< CelestialBody bodies,
System.Random  generator = null 
)
inlinestatic
static Type Contracts.ContractSystem.WeightedContractChoice ( )
inlinestatic
bool Contracts.ContractSystem.WithdrawSurplusContracts ( Contract.ContractPrestige  level,
int  maxAllowed 
)
inline

Member Data Documentation

List<System.Type> Contracts.ContractSystem.ContractTypes = null
static
Dictionary<string, int> Contracts.ContractSystem.ContractWeights = null
static
int Contracts.ContractSystem.generateContractIterations = 50
static
bool Contracts.ContractSystem.loaded
static

Is set to true once the contract system has completed loading its contracts.

List<System.Type> Contracts.ContractSystem.MandatoryTypes = null
static
List<System.Type> Contracts.ContractSystem.ParameterTypes = null
static
List<System.Type> Contracts.ContractSystem.PredicateTypes = null
static

Property Documentation

List<Contract> Contracts.ContractSystem.Contracts
get
List<Contract> Contracts.ContractSystem.ContractsFinished
get
ContractSystem Contracts.ContractSystem.Instance
staticgetset

The documentation for this class was generated from the following file: