Class Mood

  • All Implemented Interfaces:
    java.io.Serializable

    public class Mood
    extends java.lang.Object
    implements java.io.Serializable
    Class 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
      float DecayMood()
      Decays the mood according to the system's timer.
      float GetMoodValue()
      Gets a float value that represents mood.
      void SetMood​(float newMood)
      Manually sets a new value for Mood.
      java.lang.String toXml()  
      void UpdateMood​(ActiveEmotion em)
      Updates the character's mood when a given emotion is "felt" by the character.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Mood

        public Mood()
        Creates a new neutral Mood
    • 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()