Esempio n. 1
0
 public void RemoveEmotion(IActiveEmotion em, AM am)
 {
     if (em != null)
     {
         this.emotionPool.Remove(calculateHashString(em));
     }
 }
 public void RemoveEmotion(IActiveEmotion em)
 {
     if (em != null)
         this.emotionPool.Remove(calculateHashString(em,m_parent.m_am));
 }
Esempio n. 3
0
        //private static OCCBaseEmotion OCCAppraiseAttribution(IEventRecord evt, float like)
        //{
        //	const float magicFactor = 0.7f;
        //	OCCEmotionType emoType = (like >= 0)?OCCEmotionType.Love:OCCEmotionType.Hate;
        //	return new OCCBaseEmotion(emoType,Math.Abs(like)*magicFactor,evt.Id,evt.Subject==null?Name.UNIVERSAL_SYMBOL:Name.BuildName(evt.Subject));
        //}

        private static OCCBaseEmotion AppraiseGoalEnd(OCCEmotionType hopefullOutcome, OCCEmotionType fearfullOutcome, IActiveEmotion hopeEmotion, IActiveEmotion fearEmotion, float goalImportance, uint evtId, Name eventName)
        {
            OCCEmotionType finalEmotion;
            float          potential = goalImportance;

            finalEmotion = hopefullOutcome;

            if (hopeEmotion != null)
            {
                if (fearEmotion != null && fearEmotion.Intensity > hopeEmotion.Intensity)
                {
                    potential    = fearEmotion.Potential;
                    finalEmotion = fearfullOutcome;
                }
                else
                {
                    potential    = hopeEmotion.Potential;
                    finalEmotion = hopefullOutcome;
                }
            }
            else if (fearEmotion != null)
            {
                potential    = fearEmotion.Potential;
                finalEmotion = fearfullOutcome;
            }

            //The goal importance now affects 66% of the final potential value for the emotion
            potential = (potential + 2 * goalImportance) / 3;

            return(new OCCBaseEmotion(finalEmotion, potential, evtId, eventName));
        }
        //private static OCCBaseEmotion OCCAppraiseAttribution(IEventRecord evt, float like)
        //{
        //    const float magicFactor = 0.7f;
        //    OCCEmotionType emoType = (like >= 0)?OCCEmotionType.Love:OCCEmotionType.Hate;
        //    return new OCCBaseEmotion(emoType,Math.Abs(like)*magicFactor,evt.Id,evt.Subject==null?Name.UNIVERSAL_SYMBOL:Name.BuildName(evt.Subject));
        //}
        private static OCCBaseEmotion AppraiseGoalEnd(OCCEmotionType hopefullOutcome, OCCEmotionType fearfullOutcome, IActiveEmotion hopeEmotion, IActiveEmotion fearEmotion, float goalImportance, uint evtId)
        {
            OCCEmotionType finalEmotion;
            float potential = goalImportance;
            finalEmotion = hopefullOutcome;

            if(hopeEmotion != null) {
                if(fearEmotion != null && fearEmotion.Intensity > hopeEmotion.Intensity) {
                    potential = fearEmotion.Potential;
                    finalEmotion = fearfullOutcome;
                }
                else {
                    potential = hopeEmotion.Potential;
                    finalEmotion = hopefullOutcome;
                }
            }
            else if(fearEmotion != null) {
                potential = fearEmotion.Potential;
                finalEmotion = fearfullOutcome;
            }

            //The goal importance now affects 66% of the final potential value for the emotion
            potential = (potential +  2* goalImportance) / 3;

            return new OCCBaseEmotion(finalEmotion, potential, evtId);
        }