Table of Contents

Namespace TinyLife.Emotions

Classes

CombinedEmotionSource

A combined emotion source is an IEmotionSource that combines multiple underlying emotion sources together. A combined emotion source is displayed as multiple lines in the SourceString.

EmotionModifier

An emotion modifier stores information about a PersonLike's current or past actions or events that influenced their Emotion in some way. Each emotion modifier contributes to the person's emotion, and the emotion modifier with the highest combined Amount determines the person's Emotion. Emotion modifiers can be applied automatically using Condition or manually using AddEmotion(EmotionModifier, int, TimeSpan, IEmotionSource, bool).

EmotionModifier.Instance

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

EmotionType

An emotion type is a type of feeling that a PersonLike can have. The emotion that a person has results from that person's applied EmotionModifier EmotionModifier.Instances.

Interfaces

IEmotionSource

This interface can be added to classes that should be able to represent a cause of an emotion. By default, several of the game's objects, including FurnitureType, ActionType and PersonalityType have this interface. Note that, since emotion sources are serialized directly when storing a EmotionModifier.Instance, it's recommended that their default serializer is MigratingStaticJsonConverter<T>. To combine multiple emotion sources into one, you can use CombinedEmotionSource.

Enums

EmotionType.TypeCategory

An enumeration used for Category that represents a general category an emotion can fit into. The values are ordered in a way such that, if two emotion amounts sum to the same value, the one with the lower category will be chosen.