private OCCEmotionType(string name, EmotionValence valence, bool influencesMood, string[] appraisalVariables)
 {
     Name = name;
     Valence = valence;
     InfluencesMood = influencesMood;
     AppraisalVariables = appraisalVariables;
 }
 private OCCEmotionType(string name, EmotionValence valence, bool influencesMood, string[] appraisalVariables)
 {
     Name               = name;
     Valence            = valence;
     InfluencesMood     = influencesMood;
     AppraisalVariables = appraisalVariables;
 }
Beispiel #3
0
        /// <summary>
        /// Creates a new BasicEmotion
        /// </summary>
        /// <param name="type">the type of the Emotion</param>
        /// <param name="potential">the potential value for the intensity of the emotion</param>
        /// <param name="cause">the event that caused the emotion</param>
        /// <param name="direction">if the emotion is targeted to someone (ex: angry with Luke), this parameter specifies the target</param>
        protected BaseEmotion(string type, EmotionValence valence, IEnumerable <string> appraisalVariables, float potential, bool influencesMood, uint causeId, Name direction)
        {
            this.EmotionType        = type;
            this.Valence            = valence;
            this.AppraisalVariables = appraisalVariables;
            this.Potential          = potential;

            this.CauseId       = causeId;
            this.Direction     = direction;
            this.InfluenceMood = influencesMood;
        }
        /// <summary>
        /// Creates a new BasicEmotion
        /// </summary>
        /// <param name="type">the type of the Emotion</param>
        /// <param name="potential">the potential value for the intensity of the emotion</param>
        /// <param name="cause">the event that caused the emotion</param>
        /// <param name="direction">if the emotion is targeted to someone (ex: angry with Luke), this parameter specifies the target</param>
        protected BaseEmotion(string type, EmotionValence valence, IEnumerable<string> appraisalVariables, float potential, bool influencesMood, uint causeId, Name direction)
        {
            this.EmotionType = type;
            this.Valence = valence;
            this.AppraisalVariables = appraisalVariables;
            this.Potential = potential;

            this.CauseId = causeId;
            this.Direction = direction;
            this.InfluenceMood = influencesMood;
        }
 protected BaseEmotion(string type, EmotionValence valence, IEnumerable <string> appraisalVariables, float potential, bool influencesMood, uint causeId, Name eventName) :
     this(type, valence, appraisalVariables, potential, influencesMood, causeId, null, eventName)
 {
 }
 public void SetObjectData(ISerializationData dataHolder, ISerializationContext context)
 {
     Decay = dataHolder.GetValue<int>("Decay");
     Threshold = dataHolder.GetValue<int>("Threshold");
     CauseId = dataHolder.GetValue<uint>("CauseId");
     var dir = dataHolder.GetValue<string>("Direction");
     Direction = !string.IsNullOrEmpty(dir) ? Name.BuildName(dir) : null;
     EmotionType = dataHolder.GetValue<string>("EmotionType");
     Valence = dataHolder.GetValue<EmotionValence>("Valence");
     AppraisalVariables = dataHolder.GetValue<string[]>("AppraisalVariables");
     InfluenceMood = dataHolder.GetValue<bool>("InfluenceMood");
     this.intensityATt0 = this.Intensity = dataHolder.GetValue<float>("Intensity");
     if(!(context.Context is ulong))
         throw new Exception("Unable to deserialize Active Emotion. Invalid serialization context.");
     this.tickATt0 = (ulong)context.Context;
 }
 public Emotion Get(EmotionValence emotionValence, Emotivector.Expectancy.Valence valence,
                    Emotivector.Expectancy.Change change)
 {
     return(_table[(int)emotionValence, (int)valence * 3 + (int)change]);
 }
 public void Set(EmotionValence emotionValence, Emotivector.Expectancy.Valence valence,
                 Emotivector.Expectancy.Change change,
                 Emotion emotion)
 {
     _table[(int)emotionValence, (int)valence * 3 + (int)change] = emotion;
 }
 protected BaseEmotion(string type, EmotionValence valence, IEnumerable<string> appraisalVariables, float potential, bool influencesMood, uint causeId)
     : this(type, valence, appraisalVariables, potential, influencesMood, causeId, null)
 {
 }