Class Upgrade
An upgrade is a modification that can be applied to Furniture to change the way it behaves. New upgrades can be registered using Register(Upgrade), and upgrades can be queried for a Furniture object using HasFullUpgrade(Upgrade) and GetAppliedUpgrade(Upgrade).
[JsonConverter(typeof(MigratingStaticJsonConverter<Upgrade>), new object[] { typeof(Upgrade), "PrivateUpgrades", true })]
public class Upgrade : IEmotionSource
- Inheritance
-
Upgrade
- Implements
- Inherited Members
- Extension Methods
Constructors
Upgrade(string, TextureRegion, int, int, ObjectCategory)
Creates a new upgrade with the given settings.
public Upgrade(string name, TextureRegion icon, int requiredSkillLevel, int price, ObjectCategory validObjects)
Parameters
name
stringThe name of this upgrade, which should be unique.
icon
TextureRegionThe icon of this upgrade.
requiredSkillLevel
intThe skill level that is required to be able to apply this upgrade.
price
intThe price for applying this upgrade.
validObjects
ObjectCategoryA combined flag of ObjectCategory flags that determine which objects this upgrade can be applied on.
Fields
BetterMemory
public static readonly Upgrade BetterMemory
Field Value
BetterPressure
public static readonly Upgrade BetterPressure
Field Value
Bidet
public static readonly Upgrade Bidet
Field Value
ConfigurableShowerHead
public static readonly Upgrade ConfigurableShowerHead
Field Value
FridgeTemperatureControl
public static readonly Upgrade FridgeTemperatureControl
Field Value
Icon
The icon of this upgrade.
public readonly TextureRegion Icon
Field Value
- TextureRegion
Name
The name of this upgrade, which should be unique.
public readonly string Name
Field Value
Price
The price for applying this upgrade.
public readonly int Price
Field Value
ProtectiveCoating
public static readonly Upgrade ProtectiveCoating
Field Value
RequiredSkillLevel
The skill level that is required to be able to apply this upgrade.
public readonly int RequiredSkillLevel
Field Value
RgbLights
public static readonly Upgrade RgbLights
Field Value
SofterCushioning
public static readonly Upgrade SofterCushioning
Field Value
SwivelFaucet
public static readonly Upgrade SwivelFaucet
Field Value
TemperatureGauge
public static readonly Upgrade TemperatureGauge
Field Value
Upgrades
The collection of all registered upgrades. New upgrades can be registered using Register(Upgrade).
public static readonly ReadOnlyDictionary<string, Upgrade> Upgrades
Field Value
ValidObjects
A combined flag of ObjectCategory flags that determine which objects this upgrade can be applied on.
public readonly ObjectCategory ValidObjects
Field Value
WaterPurifier
public static readonly Upgrade WaterPurifier
Field Value
Properties
HasToLearn
public bool HasToLearn { get; init; }
Property Value
Memory
The memory for this upgrade, which is stored in UpgradeLearned. An upgrade can only be applied by a PersonLike if they have this memory. Note that, if HasToLearn is false, this will return null.
public MemoryType Memory { get; }
Property Value
Requirements
A set of Upgrades that optionally need to be applied first before this upgrade can be applied.
public Func<Upgrade[]> Requirements { get; init; }
Property Value
SourceString
A (localized) string that is displayed when hovering over an EmotionModifier that has this source
public string SourceString { get; }
Property Value
Methods
Knows(PersonLike)
Returns whether the given PersonLike knows this upgrade. If HasToLearn is false, this method always returns true.
public bool Knows(PersonLike person)
Parameters
person
PersonLikeThe person.
Returns
- bool
Whether the person knows this upgrade.
Learn(PersonLike)
Causes the given PersonLike to learn this upgrade, adding the appropriate Memory to them and optionally displaying a notification.
public void Learn(PersonLike person)
Parameters
person
PersonLikeThe person who should learn this upgrade.
Register(Upgrade)
public static Upgrade Register(Upgrade upgrade)
Parameters
upgrade
UpgradeThe upgrade to register.
Returns
- Upgrade
The
upgrade
, for chaining.