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 PersonLike Person { get; protected set; }

Property Value

PersonLike

Source

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

public IEmotionSource Source { get; }

Property Value

IEmotionSource

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(PersonLike)

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

public bool Validate(PersonLike person)

Parameters

person PersonLike

The person that this emotion modifier belongs to

Returns

bool

Whether this emotion modifier is still valid