Class ActiveEmotion

  • All Implemented Interfaces:
    java.io.Serializable

    public class ActiveEmotion
    extends BaseEmotion
    Represents an Emotion with intensity that is active in the character's emotional state, i.e, the character is feeling the emotion
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Field Detail

      • _decay

        protected int _decay
      • _intensity

        protected float _intensity
      • _threshold

        protected int _threshold
      • _baseEmotionClass

        protected java.lang.Object _baseEmotionClass
    • Constructor Detail

      • ActiveEmotion

        public ActiveEmotion​(BaseEmotion potEm,
                             float potential,
                             int threshold,
                             int decay)
        Creates a new ActiveEmotion
        Parameters:
        potEm - - the BaseEmotion that is the base for this ActiveEmotion
        potential - - the potential for the intensity of the emotion
        threshold - - the threshold for the specific emotion
        decay - - the decay rate for the specific emotion
    • Method Detail

      • DecayEmotion

        public float DecayEmotion()
        Decays the emotion according to the system's timer
        Returns:
        the intensity of the emotion after being decayed
      • GetIntensity

        public float GetIntensity()
        Gets the emotion's intensity
        Returns:
        the intensity of the emotion
      • getBaseEmotionClass

        public java.lang.Object getBaseEmotionClass()
      • ReforceEmotion

        public void ReforceEmotion​(float potential)
        Reforces the intensity of the emotion by a given potential
        Parameters:
        potential - - the potential for the reinformcement of the emotion's intensity
      • SetDecay

        public void SetDecay​(int decay)
        Sets the decay rate for the emotion
        Parameters:
        decay - - the new decay rate (ranged between 1 and 10)
      • SetIntensity

        public void SetIntensity​(float potential)
        Sets the intensity of the emotion
        Parameters:
        potential - - the potential for the emotion's intensity
      • GetPotential

        public float GetPotential()
        Gets the emotion's potential
        Overrides:
        GetPotential in class BaseEmotion
        Returns:
        - the potential for the intensity of the emotion
      • SetThreshold

        public void SetThreshold​(int threshold)
        Sets the threshold for the specific emotion
        Parameters:
        threshold - - the new threshold (ranged between 1 and 10)
      • toXml

        public java.lang.String toXml()
        Converts the ActiveEmotion to XMl
        Returns:
        a XML String that contains all information about the ActiveEmotion