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

Classes

class  Upgrade
 Upgrade holder. More...
 

Public Member Functions

virtual bool AddUpgrade (Upgrade up)
 Adds the upgrade to the set of upgrades and updates as necessary. If tech required is nonnull, adds to tech lookup. More...
 
virtual bool CanHaveUpgrades ()
 Returns true if not in a save game or if the save game's difficulty options allow upgrades More...
 
virtual void FillUpgrades ()
 Fill the upgrade holders based on PARTUPGRADE nodes and from partmodules' UPGRADES nodes if those aren't previously found. More...
 
virtual IEnumerator GetEnumerator ()
 
virtual Upgrade GetUpgrade (string name)
 Gets the upgrade of that name (if it exists) else returns null More...
 
virtual float GetUpgradeCost (string name)
 Gets the unlock cost of the upgrade, if any More...
 
virtual List< UpgradeGetUpgradesForTech (string tech)
 Returns the list of upgrades linked to the given tech More...
 
virtual bool IsAvailableToUnlock (string name)
 Like IsUnlocked but flips the unlocked check. I.e. returns true iff science sandbox/career and tech node unlocked and upgrade not unlocked. More...
 
virtual bool IsEnabled (string name)
 Returns true if the upgrade is unlocked and enabled (or unlocked and AllEnabled is true). Returns false otherwise. More...
 
virtual bool IsUnlocked (string name)
 Returns true if the upgrade is unlocked (or if entry costs are disabled). Returns false if upgrades are disabled in the current game. More...
 
virtual void LinkUpgrades ()
 Links the upgrades with the parts and partmodules which use them More...
 
virtual void OnLoad (ConfigNode node)
 
virtual void OnSave (ConfigNode node)
 
virtual bool RemoveUpgrade (string name)
 Removes the upgrade of the given name More...
 
virtual void SetEnabled (string name, bool val)
 Sets the enabled state of an upgrade More...
 
virtual void SetUnlocked (string name, bool val)
 Sets the unlocked state of an upgrade More...
 
virtual bool UgpradesAllowed ()
 Does the current game mode/parameters support upgrades? More...
 

Static Public Attributes

static bool AllEnabled = true
 Don't check if the upgrade is enabled, return true as long as it's unlocked. More...
 

Protected Attributes

Dictionary< Upgrade, bool > enableds = new Dictionary<Upgrade, bool>()
 
ListDictionary< string, UpgradetechToUpgrades = new ListDictionary<string, Upgrade>()
 
Dictionary< Upgrade, bool > unlocks = new Dictionary<Upgrade, bool>()
 
Dictionary< string, Upgradeupgrades = new Dictionary<string, Upgrade>()
 

Member Function Documentation

virtual bool PartUpgradeHandler.AddUpgrade ( Upgrade  up)
inlinevirtual

Adds the upgrade to the set of upgrades and updates as necessary. If tech required is nonnull, adds to tech lookup.

Parameters
up
Returns
virtual bool PartUpgradeHandler.CanHaveUpgrades ( )
inlinevirtual

Returns true if not in a save game or if the save game's difficulty options allow upgrades

Returns
virtual void PartUpgradeHandler.FillUpgrades ( )
inlinevirtual

Fill the upgrade holders based on PARTUPGRADE nodes and from partmodules' UPGRADES nodes if those aren't previously found.

virtual IEnumerator PartUpgradeHandler.GetEnumerator ( )
inlinevirtual
virtual Upgrade PartUpgradeHandler.GetUpgrade ( string  name)
inlinevirtual

Gets the upgrade of that name (if it exists) else returns null

Parameters
name
Returns
virtual float PartUpgradeHandler.GetUpgradeCost ( string  name)
inlinevirtual

Gets the unlock cost of the upgrade, if any

Parameters
name
Returns
virtual List<Upgrade> PartUpgradeHandler.GetUpgradesForTech ( string  tech)
inlinevirtual

Returns the list of upgrades linked to the given tech

Parameters
tech
Returns
virtual bool PartUpgradeHandler.IsAvailableToUnlock ( string  name)
inlinevirtual

Like IsUnlocked but flips the unlocked check. I.e. returns true iff science sandbox/career and tech node unlocked and upgrade not unlocked.

Parameters
name
Returns
virtual bool PartUpgradeHandler.IsEnabled ( string  name)
inlinevirtual

Returns true if the upgrade is unlocked and enabled (or unlocked and AllEnabled is true). Returns false otherwise.

Parameters
name
Returns
virtual bool PartUpgradeHandler.IsUnlocked ( string  name)
inlinevirtual

Returns true if the upgrade is unlocked (or if entry costs are disabled). Returns false if upgrades are disabled in the current game.

Parameters
name
Returns
virtual void PartUpgradeHandler.LinkUpgrades ( )
inlinevirtual

Links the upgrades with the parts and partmodules which use them

virtual void PartUpgradeHandler.OnLoad ( ConfigNode  node)
inlinevirtual
virtual void PartUpgradeHandler.OnSave ( ConfigNode  node)
inlinevirtual
virtual bool PartUpgradeHandler.RemoveUpgrade ( string  name)
inlinevirtual

Removes the upgrade of the given name

Parameters
name
Returns
virtual void PartUpgradeHandler.SetEnabled ( string  name,
bool  val 
)
inlinevirtual

Sets the enabled state of an upgrade

Parameters
name
val
virtual void PartUpgradeHandler.SetUnlocked ( string  name,
bool  val 
)
inlinevirtual

Sets the unlocked state of an upgrade

Parameters
name
val
virtual bool PartUpgradeHandler.UgpradesAllowed ( )
inlinevirtual

Does the current game mode/parameters support upgrades?

Returns

Member Data Documentation

bool PartUpgradeHandler.AllEnabled = true
static

Don't check if the upgrade is enabled, return true as long as it's unlocked.

Dictionary<Upgrade, bool> PartUpgradeHandler.enableds = new Dictionary<Upgrade, bool>()
protected
ListDictionary<string, Upgrade> PartUpgradeHandler.techToUpgrades = new ListDictionary<string, Upgrade>()
protected
Dictionary<Upgrade, bool> PartUpgradeHandler.unlocks = new Dictionary<Upgrade, bool>()
protected
Dictionary<string, Upgrade> PartUpgradeHandler.upgrades = new Dictionary<string, Upgrade>()
protected

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