Package FAtiMA.Core.emotionalState
Class Mood
- java.lang.Object
-
- FAtiMA.Core.emotionalState.Mood
-
- All Implemented Interfaces:
java.io.Serializable
public class Mood extends java.lang.Object implements java.io.SerializableClass that represents a character's mood.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Mood()Creates a new neutral Mood
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatDecayMood()Decays the mood according to the system's timer.floatGetMoodValue()Gets a float value that represents mood.voidSetMood(float newMood)Manually sets a new value for Mood.java.lang.StringtoXml()voidUpdateMood(ActiveEmotion em)Updates the character's mood when a given emotion is "felt" by the character.
-
-
-
Method Detail
-
GetMoodValue
public float GetMoodValue()
Gets a float value that represents mood. Mood is ranged between [-10;10], a negative value represents a bad mood, a positive value represents good mood and values near 0 represent a neutral mood- Returns:
- a float value representing mood ranged in [-10;10]
-
DecayMood
public float DecayMood()
Decays the mood according to the system's timer.- Returns:
- the mood's intensity after being decayed
-
UpdateMood
public void UpdateMood(ActiveEmotion em)
Updates the character's mood when a given emotion is "felt" by the character.- Parameters:
em- - the ActiveEmotion that will influence the character's current mood
-
SetMood
public void SetMood(float newMood)
Manually sets a new value for Mood. Use it with caution and only when you explicitly want to change a character's mood without anything happening- Parameters:
newMood- - the new value of the mood. Must be ranged in [-10;10]. Remember that -10 represents a very bad mood, 10 a very good mood and values near 0 represent a neutral mood
-
toXml
public java.lang.String toXml()
-
-