public Animal(Types type, Gender gender, ConsumptionType consumptionType, Sizes size) { this.type = type; this.gender = gender; this.consumptionType = consumptionType; this.size = size; }
protected Animal(int x, int y, Gender gender, ConsumptionType consumptionType, World world, int health = 5) : base(x, y, world) { ConsumptionType = consumptionType; Health = health; Gender = gender; }
private static IEnumerable<string> GetConsumptionTypes(ConsumptionType? type) { if (type == null) return Enumerable.Empty<string>(); return (Enum.GetValues(typeof (ConsumptionType)) .Cast<ConsumptionType>() .Where(value => type.Value.HasFlag(value)) .Select(value => Enum.GetName(typeof (ConsumptionType), value))); }
public ActionResult CostCentres(ConsumptionType consumptionType, string term, string id) { var centres = context.CostCentres.Where(centre => ((centre.ConsumptionType & consumptionType) > 0)); if (!string.IsNullOrEmpty(term)) { centres = centres.Where(centre => centre.CostCode.Contains(term) || centre.Name.Contains(term)); } if (!string.IsNullOrEmpty(id)) { centres = centres.Where(centre => centre.CostCode == id); } var model = centres.Select(centre => new { centre.CostCode, centre.Name, centre.CurrencyCode }); return(Json(model, JsonRequestBehavior.AllowGet)); }
public void Consume(ConsumptionType type) { if (type == ConsumptionType.Food) { hungerMeter += worldInfo.grainConsumptionValue; if (hungerMeter > worldInfo.chickenMaxTimeUntilDeathHunger) { hungerMeter = worldInfo.chickenMaxTimeUntilDeathHunger; } } else if (type == ConsumptionType.Water) { thirstMeter += worldInfo.waterConsumptionValue; if (thirstMeter > worldInfo.chickenMaxTimeUntilDeathThirst) { thirstMeter = worldInfo.chickenMaxTimeUntilDeathThirst; } } }
public Dolphin(int x, int y, Gender gender, ConsumptionType consumptionType, World world) : base(x, y, gender, consumptionType, world) { }
public static Animal Create(ConsumptionType consumptionType, Sizes size) { return(new Animal(consumptionType, size)); }
public Owl(int x, int y, Gender gender, ConsumptionType consumptionType, World world) : base(x, y, gender, consumptionType, world) { Predator = consumptionType == ConsumptionType.Predator; this.world = world; }
public String getString() { return("ConsumptionType: " + ConsumptionType.ToString().ToLower() + ", Size: " + Size.ToString().ToLower()); }
public Animal(ConsumptionType consumptionType, Sizes size) { ConsumptionType = consumptionType; Size = size; }
public ConsumerConfigBuilder <T> SetConsumptionType(ConsumptionType type) { _conf.ConsumptionType = type; return(this); }