public void UpdateHungerLevel(HungerLevel hunger) { Color color = Color.white; // These colors don't make sense with the states switch (hunger) { case HungerLevel.Faint: color = Color.red; break; case HungerLevel.Starving: color = Color.yellow; break; case HungerLevel.Hungry: color = Color.yellow; break; case HungerLevel.Satiated: color = Color.blue; break; case HungerLevel.Stuffed: color = Color.yellow; break; } BigBoss.Gooey.UpdateHungerText(color); BigBoss.Gooey.CreateTextMessage(hunger.ToString() + "!", color); }
protected void getHungerLevel(float hunger) { HungerLevel prior = Stats.HungerLevel; // These numbers don't make sense. if (hunger < 50) { Stats.HungerLevel = HungerLevel.Faint; } else if (hunger < 130) { Stats.HungerLevel = HungerLevel.Starving; } else if (hunger < 500) { Stats.HungerLevel = HungerLevel.Hungry; } else if (hunger < 800) { Stats.HungerLevel = HungerLevel.Satiated; } else if (hunger < 1000) { Stats.HungerLevel = HungerLevel.Stuffed; } if (prior != Stats.HungerLevel) { BigBoss.Gooey.UpdateHungerLevel(Stats.HungerLevel); } }
public void Convert(Entity entity, EntityManager entityManager, GameObjectConversionSystem conversionSystem) { entityManager.AddComponent(entity, typeof(InsideRoom)); var hunger = new HungerLevel(); hunger.Value = 50; var happy = new HappinessLevel(); happy.Value = 50; var temperature = new Temperature(); temperature.Value = 68; var timeRemaining = new TimeToLeave(); timeRemaining.TimeRemaining = 60; entityManager.AddComponentData(entity, hunger); entityManager.AddComponentData(entity, happy); entityManager.AddComponentData(entity, temperature); entityManager.AddComponentData(entity, timeRemaining); }
public async Task <ActionResult <long> > AddInmate(string name, decimal size, ArrestLocation arrestLocation, HungerLevel hungerLevel, HappinessLevel happinessLevel) { _logger.LogInformation("I just got an AddInmate request"); return(await _inmateCrudService.AddInmateAndReturnId(name, size, arrestLocation, hungerLevel, happinessLevel)); }