EmotionalAppraisal.ActiveEmotion.ToDto C# (CSharp) Méthode

ToDto() public méthode

public ToDto ( AM am ) : EmotionDTO
am AutobiographicMemory.AM
Résultat EmotionalAppraisal.DTOs.EmotionDTO
        public EmotionDTO ToDto(AM am)
        {
            return new EmotionDTO
            {
                Type = this.EmotionType,
                Intensity = this.Intensity,
                CauseEventId =  this.CauseId,
                CauseEventName = am.RecallEvent(this.CauseId).EventName.ToString(),
            };
        }

Usage Example

Exemple #1
0
        public EmotionDTO AddActiveEmotion(EmotionDTO emotion, AM am)
        {
            var activeEmotion = new ActiveEmotion(emotion, am, 1, 1);

            if (emotionPool.ContainsKey(calculateHashString(activeEmotion)))
            {
                throw new ArgumentException("This given emotion is already related to given cause", nameof(emotion));
            }

            emotionPool.Add(calculateHashString(activeEmotion), activeEmotion);
            activeEmotion.GetCause(am).LinkEmotion(activeEmotion.EmotionType);
            return(activeEmotion.ToDto(am));
        }
All Usage Examples Of EmotionalAppraisal.ActiveEmotion::ToDto