Table of Contents

Class EmotionModifier.Instance

Namespace
TinyLife.Emotions
Assembly
Tiny Life.dll

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

[DataContract]
public class EmotionModifier.Instance
Inheritance
EmotionModifier.Instance
Inherited Members
Extension Methods

Fields

Amount

The amount that this emotion modifier's Type has

[DataMember]
public readonly int Amount

Field Value

int

TotalTime

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

[DataMember]
public readonly TimeSpan TotalTime

Field Value

TimeSpan

Type

The emotion modifier that this instance contains

[DataMember]
public readonly EmotionModifier Type

Field Value

EmotionModifier

Properties

Person

The person that is currently experiencing this emotion.

public Person Person { get; protected set; }

Property Value

Person

SourceString

The SourceString of the IEmotionSource that caused this emotion modifier to occur. If there is no source, null is returned.

[DataMember]
public string SourceString { get; protected set; }

Property Value

string

Time

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

[DataMember]
public TimeSpan Time { get; protected set; }

Property Value

TimeSpan

Methods

PassTime(TimeSpan)

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

public void PassTime(TimeSpan passedInGame)

Parameters

passedInGame TimeSpan

The amount of time that should pass

Validate(Person)

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

public bool Validate(Person person)

Parameters

person Person

The person that this emotion modifier belongs to

Returns

bool

Whether this emotion modifier is still valid