EmotionModifier_Instance - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife.Emotions.EmotionModifier

EmotionModifier.Instance Class

This class represents an applied instance of a EmotionModifier.
It is used by AddEmotion(EmotionModifier, int, TimeSpan, bool).

public class EmotionModifier.Instance

Inheritance System.Object 🡒 Instance

Constructors

EmotionModifier.Instance.Instance(EmotionModifier, int, TimeSpan) Constructor

Creates a new EmotionModifier instance with the given settings

public Instance(TinyLife.Emotions.EmotionModifier type, int amount, System.TimeSpan time);

Parameters

type EmotionModifier
The emotion modifier of this instance

amount System.Int32
The amount that this instance should yield

time System.TimeSpan
The time that this instance should last for

Fields

EmotionModifier.Instance.Amount Field

The amount that this emotion modifier's Type has

public readonly int Amount;

Field Value

System.Int32

EmotionModifier.Instance.TotalTime Field

The total amount of in-game time that this emotion modifier lasts for

public readonly TimeSpan TotalTime;

Field Value

System.TimeSpan

EmotionModifier.Instance.Type Field

The emotion modifier that this instance contains

public readonly EmotionModifier Type;

Field Value

EmotionModifier

Properties

EmotionModifier.Instance.Time Property

The amount of in-game time remaining of this modifier, out of TotalTime

public System.TimeSpan Time { get; set; }

Property Value

System.TimeSpan

Methods

EmotionModifier.Instance.PassTime(TimeSpan) Method

Causes Time to pass by the given System.TimeSpan.
If Time is equal to System.TimeSpan.MaxValue, nothing happens.

public void PassTime(System.TimeSpan passedInGame);

Parameters

passedInGame System.TimeSpan
The amount of time that should pass

EmotionModifier.Instance.Validate(Person) Method

Validates this emotion modifier using the given Person after it is loaded from disk.
This method is automatically called in Validate().

public bool Validate(TinyLife.Objects.Person person);

Parameters

person Person
The person that this emotion modifier belongs to

Returns

System.Boolean
Whether this emotion modifier is still valid