Esempio n. 1
0
        public System.Drawing.Image ConvertEnumToImage(EmotionEnum passedEnum)
        {
            switch (passedEnum)
            {
            case EmotionEnum.Happy:
                return(global::iVirtuaPet.Properties.Resources.happy);

            case EmotionEnum.Sad:
                return(global::iVirtuaPet.Properties.Resources.sad);

            case EmotionEnum.Angry:
                return(global::iVirtuaPet.Properties.Resources.angry);

            case EmotionEnum.Asleep:
                return(global::iVirtuaPet.Properties.Resources.asleep);

            case EmotionEnum.Hungry:
                return(global::iVirtuaPet.Properties.Resources.hungry);

            case EmotionEnum.Sleepy:
                return(global::iVirtuaPet.Properties.Resources.sleepy);

            case EmotionEnum.Unknown:
                return(global::iVirtuaPet.Properties.Resources.unknown);

            case EmotionEnum.Indifferent:
                return(global::iVirtuaPet.Properties.Resources.indifferent);

            case EmotionEnum.Dead:
                return(global::iVirtuaPet.Properties.Resources.dead);

            default:
                return(global::iVirtuaPet.Properties.Resources.unknown);
            }
        }
Esempio n. 2
0
    public string getEmotion()
    {
        EmotionValue = GameObject.Find("VRCameraController").GetComponent <PlayerEmotions>().getMaxEmotion();
        EmotionEnum Emo = (EmotionEnum)EmotionValue[0];

        return(Emo.ToString());
    }
Esempio n. 3
0
 /// <summary>
 /// Gets the maximum.
 /// </summary>
 /// <param name="currentValue">The current value.</param>
 /// <param name="comparedValue">The compared value.</param>
 /// <param name="currentNumber">The current number.</param>
 /// <param name="comparedNumber">The compared number.</param>
 private void GetMax(ref decimal currentValue, decimal comparedValue, ref EmotionEnum currentNumber, EmotionEnum comparedNumber)
 {
     if (currentValue < comparedValue)
     {
         currentValue  = comparedValue;
         currentNumber = comparedNumber;
     }
 }
Esempio n. 4
0
    public string getEmotionText()
    {
        EmotionValue = GameObject.Find("VRCameraController").GetComponent <PlayerEmotions>().getMaxEmotion();
        //Debug.Log("EmoNum : " + EmotionValue[0] + ", EmoValue : " + EmotionValue[1] + ", Emotion : " + (EmotionEnum)EmotionValue[0]);
        EmotionEnum Emo = (EmotionEnum)EmotionValue[0];

        return(Emo.DisplayEmotion());
    }
Esempio n. 5
0
        EmotionEnum GetEmotion(Emotion emotion)
        {
            EmotionEnum maxEmotionEnum  = EmotionEnum.Anger;
            double      maxEmotionValue = 0.0;

            if (emotion.Contempt > maxEmotionValue)
            {
                maxEmotionValue = emotion.Contempt;
                maxEmotionEnum  = EmotionEnum.Contempt;
            }
            if (emotion.Disgust > maxEmotionValue)
            {
                maxEmotionValue = emotion.Disgust;
                maxEmotionEnum  = EmotionEnum.Disgust;
            }
            if (emotion.Fear > maxEmotionValue)
            {
                maxEmotionValue = emotion.Fear;
                maxEmotionEnum  = EmotionEnum.Fear;
            }

            if (emotion.Happiness > maxEmotionValue)
            {
                maxEmotionValue = emotion.Happiness;
                maxEmotionEnum  = EmotionEnum.Happiness;
            }

            if (emotion.Neutral > maxEmotionValue)
            {
                maxEmotionValue = emotion.Neutral;
                maxEmotionEnum  = EmotionEnum.Neutral;
            }

            if (emotion.Sadness > maxEmotionValue)
            {
                maxEmotionValue = emotion.Sadness;
                maxEmotionEnum  = EmotionEnum.Sadness;
            }

            if (emotion.Surprise > maxEmotionValue)
            {
                maxEmotionValue = emotion.Surprise;
                maxEmotionEnum  = EmotionEnum.Surprise;
            }
            return(maxEmotionEnum);
        }
Esempio n. 6
0
 public Button(string id = "", string buttonName = "", string buttonText = "", EmotionEnum emotion = EmotionEnum.Cool, ButtonTypeEnum buttonType = ButtonTypeEnum.None, string nextNodeId = "", bool defaultButton = false, bool hidden = false, string variableValue = "")
 {
     this._id           = id;
     this.ButtonName    = buttonName;
     this.ButtonText    = buttonText;
     this.Emotion       = emotion;
     this.ButtonType    = buttonType;
     this.NextNodeId    = nextNodeId;
     this.DefaultButton = defaultButton;
     this.Hidden        = hidden;
     this.VariableValue = variableValue;
 }
Esempio n. 7
0
 public DetectedResult(EmotionEnum e, float v)
 {
     emotion = e;
     value   = v;
 }
Esempio n. 8
0
        public EmotionEnum SetDefaultEmotion()
        {
            EmotionEnum defaultEnum = EmotionEnum.Happy;

            return(defaultEnum);
        }
Esempio n. 9
0
        public EmotionEnum CurrentEmotion()
        {
            EmotionEnum currentEnum = EmotionSet;

            return(currentEnum);
        }
Esempio n. 10
0
        public EmotionEnum ChangeEmotion(EmotionEnum emotion)
        {
            EmotionSet = emotion;

            return(emotion);
        }
Esempio n. 11
0
 public Emotion()
 {
     EmotionSet = SetDefaultEmotion();
 }
Esempio n. 12
0
        void GetMaxEmotionOnGroup(List <PersonAttributes> personAttributes)
        {
            var neutralPeople   = personAttributes?.Count(p => p.Emotion == EmotionEnum.Neutral);
            var happyPeople     = personAttributes?.Count(p => p.Emotion == EmotionEnum.Happiness);
            var sadPeople       = personAttributes?.Count(p => p.Emotion == EmotionEnum.Sadness);
            var surprisedPeople = personAttributes?.Count(p => p.Emotion == EmotionEnum.Surprise);

            EmotionEnum firstEmotion   = EmotionEnum.Neutral;
            int?        counterEmotion = neutralPeople ?? 0;

            if (happyPeople > counterEmotion)
            {
                firstEmotion   = EmotionEnum.Happiness;
                counterEmotion = happyPeople;
            }
            if (sadPeople > counterEmotion)
            {
                firstEmotion   = EmotionEnum.Sadness;
                counterEmotion = sadPeople;
            }

            if (surprisedPeople > counterEmotion)
            {
                firstEmotion   = EmotionEnum.Surprise;
                counterEmotion = surprisedPeople;
            }
            var emotionText = string.Empty;

            switch (firstEmotion)
            {
            case EmotionEnum.Anger:
                emotionText = "enfado";
                break;

            case EmotionEnum.Contempt:
                emotionText = "desprecio";
                break;

            case EmotionEnum.Disgust:
                emotionText = "asco";
                break;

            case EmotionEnum.Fear:
                emotionText = "temor";
                break;

            case EmotionEnum.Happiness:
                emotionText = "felicidad";
                break;

            case EmotionEnum.Neutral:
                emotionText = "neutral";
                break;

            case EmotionEnum.Sadness:
                emotionText = "tristeza";
                break;

            case EmotionEnum.Surprise:
                emotionText = "sorpresa";
                break;
            }

            EmotionText = string.IsNullOrWhiteSpace(emotionText)
                                ? string.Empty
                                : $"Emoción más repetida: { emotionText}";
        }
Esempio n. 13
0
 public void Set(EmotionEnum value)
 {
     Set(value.ToString());
 }
Esempio n. 14
0
 public Emotion(EmotionEnum name, float intensity = 0.5f)
 {
     Name      = name;
     Intensity = intensity;
 }