Example #1
0
 public static void ChangeMood(IMood person, IList <IFood> foods)
 {
     foreach (var food in foods)
     {
         person.Mood += food.Happiness;
     }
 }
Example #2
0
 public MoodViewModel(IMood mood)
 {
     if (mood == null)
     {
         throw new Exception("No valid mood");
     }
     Target = mood;
 }
Example #3
0
 public DeviceGroupStatus(
     string name,
     DateTime createdAt,
     int lightState,
     int lightDimmer,
     IMood activeMood,
     IDevice[] devices)
 {
     CreatedAt   = createdAt;
     Name        = name;
     LightState  = lightState;
     LightDimmer = lightDimmer;
     ActiveMood  = activeMood;
     Devices     = devices;
 }
Example #4
0
 public static Color GetColor(IMood mood)
 {
     if (mood.MoodType == MoodBaseType.Neutral)
     {
         return(Colors.White);
     }
     if (mood.MoodType == MoodBaseType.Joy)
     {
         return(Colors.Yellow);
     }
     if (mood.MoodType == MoodBaseType.Sadness)
     {
         return(Colors.Blue);
     }
     if (mood.MoodType == MoodBaseType.Disgust)
     {
         return(Colors.Green);
     }
     if (mood.MoodType == MoodBaseType.Anger)
     {
         return(Colors.Red);
     }
     if (mood.MoodType == MoodBaseType.Fear)
     {
         return(Colors.DeepPink);
     }
     if (mood.MoodType == MoodBaseType.Curious)
     {
         return(Colors.LightSkyBlue);
     }
     if (mood.MoodType == MoodBaseType.Panic)
     {
         return(Colors.SandyBrown);
     }
     if (mood.MoodType == MoodBaseType.Surprise)
     {
         return(Colors.Orange);
     }
     if (mood.MoodType == MoodBaseType.Exciting)
     {
         return(Colors.Pink);
     }
     return(Colors.White);
 }
Example #5
0
 public void InitContact(Person person)
 {
     mood = GetMood(person);
 }
Example #6
0
 public Person(string name, int age)
 {
     this.Name = name;
     this.Age  = age;
     this.mood = new NormalMood();
 }
Example #7
0
 public MoodService(IMood <Mood> repository, IMapper mapper)
 {
     _repository = repository;
     _mapper     = mapper;
 }
Example #8
0
 public MoodController(IMapper mapper, IMood <Mood> service)
 {
     _service = new MoodService <MoodData>(service, mapper);
 }