public void AddPointsToParasite(FoodTypes stats, int increase) { switch (stats) { case FoodTypes.blue: if (_parasite.statBlue < _parasite.statBlueMax) { _parasite.statBlue += increase; } break; case FoodTypes.red: if (_parasite.statRed < _parasite.statRedMax) { _parasite.statRed += increase; } break; case FoodTypes.yellow: if (_parasite.statYellow < _parasite.statYellowMax) { _parasite.statYellow += increase; } break; } if (_parasite.statBlue >= _parasite.statBlueMax && _parasite.statRed >= _parasite.statRedMax && _parasite.statYellow >= _parasite.statYellowMax && GameStateManager.instance.gameWon == false) { FindObjectOfType <CanvasController>().OnGameWon(); } }
private void CurrentObjectives_CollectionChanged(System.Collections.ICollection source, Utilities.Collections.NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { for (int i = 0; i < e.NewItems.Count; i++) { if (_ObjectiveImages.Length < i) return; _ObjectiveImages[i].Texture = Food.GetFoodImage(((FoodObjective)e.NewItems[i]).FoodType).texture; objectif = ((FoodObjective)e.NewItems[i]).FoodType; _ObjectiveImages[i].Show(); ((FoodObjective)e.NewItems[i]).PropertyChanged += ObjectivesUIManager_PropertyChanged; } } else if (e.Action == NotifyCollectionChangedAction.Remove) { for (int i = 0; i < e.OldItems.Count; i++) { ((FoodObjective)e.NewItems[i]).PropertyChanged -= ObjectivesUIManager_PropertyChanged; } } else if (e.Action == NotifyCollectionChangedAction.Reset) { for (int i = 0; i < e.OldItems.Count; i++) { ((FoodObjective)e.NewItems[i]).PropertyChanged -= ObjectivesUIManager_PropertyChanged; } } }
public BaseCard(decimal price, CountriesEnum country, HotelTypes hotelClass, FoodTypes food) { Price = price; Country = country; HotelClass = hotelClass; Food = food; }
public Excursion(decimal price, CountriesEnum country, HotelTypes hotelClass, FoodTypes food) : base(price, country, hotelClass, food) { Price = price; Country = country; HotelClass = hotelClass; Food = food; }
public static int Power(FoodTypes type) { switch (type) { case FoodTypes.Berry: return(8); default: return(0); } }
/// <summary> /// Checks the given food products current amount in the store inventory /// </summary> /// <param name="productToCheck"></param> public void CheckProductInventory(Enum productToCheck) { using var context = new joshfordproject0Context(s_dbContextOptions); FoodTypes foodInvCheck = (FoodTypes)productToCheck; int productAmount = 0; // SQL Query for food inventory Console.WriteLine($"Current amount of {foodInvCheck} is: {productAmount}"); }
public void GetProductPrice(Enum productToPrice) { using var context = new joshfordproject0Context(s_dbContextOptions); FoodTypes foodToPrice = (FoodTypes)productToPrice; var priceOfFood = context.Products .Select(x => x.ProductPrice) .Where(x => x.Equals(foodToPrice.ToString())); Console.WriteLine($"{foodToPrice}: $ {priceOfFood}"); }
public void EatFood(FoodTypes type, int amount) { var food = _food[(int)type]; var actualAmount = Math.Min(amount, food.Amount); Fullness += actualAmount * FoodType.Power(type); _food[(int)type].Amount -= actualAmount; for (int i = 0; i < actualAmount; ++i) { _digestionTimers.Add(_random.Next(Planet.Config.PopBerryDigestDelayMin, Planet.Config.PopBerryDigestDelayMax + 1)); } }
public ActionResult <Warrior> Eat(string id, FoodTypes food) { var warrior = WarriorCollection.Warriors.FirstOrDefault(w => w.Id == id); if (warrior == null) { return(NotFound()); } warrior.Eat(food); return(Ok(warrior)); }
void OnTriggerEnter2D(Collider2D collision) { string tagCheck = collision.gameObject.tag; switch (tagCheck) { case "Table": if (collision.GetComponent <Table>().currentTableState == TableState.SEATED && !collision.GetComponent <Table>().orderGotten) { orderHolder.Add(collision.GetComponent <Table>().currentOrder); collision.GetComponent <Table>().orderGotten = true; } else if (collision.GetComponent <Table>().currentTableState == TableState.SEATED && collision.GetComponent <Table>().orderGotten) { if (removeOrder) { collision.GetComponent <Table>().ServeFood(readyOrder); removeOrder = false; } } else if (collision.GetComponent <Table>().currentTableState == TableState.BILLING) { collision.GetComponent <Table>().BillTable(); } else if (collision.GetComponent <Table>().currentTableState == TableState.CLEANUP) { collision.GetComponent <Table>().CleanUpTable(); } break; case "Kitchen": if (!collision.GetComponent <MakeFood>().ready&& !removeOrder) { MakeFood kitchen = collision.GetComponent <MakeFood>(); kitchen.foodToCook = orderHolder[0].FoodOrders[0]; orderHolder.Remove(orderHolder[0]); kitchen.startCooking = true; removeOrder = false; } else if (collision.GetComponent <MakeFood>().ready) { readyOrder = collision.GetComponent <MakeFood>().foodToCook; collision.GetComponent <MakeFood>().ready = false; collision.GetComponent <MakeFood>().startCooking = false; removeOrder = true; } break; default: break; } }
/// <summary> /// Warrior eats food /// </summary> /// <param name="food">The food<see cref="FoodTypes"/></param> public void Eat(FoodTypes food) { switch (food) { case FoodTypes.Carrot: Health += 10; break; case FoodTypes.Bread: Health += 20; break; } }
public Order(int Total) { GameManager = GameObject.FindObjectOfType <KitchenGameManager>(); // Initialize our Food Order List FoodOrders = new List <FoodTypes>(); // Make sure Total does not go beyond enum length if (Total > System.Enum.GetNames(typeof(FoodTypes)).Length) { Total = System.Enum.GetNames(typeof(FoodTypes)).Length; } // Continue adding a new food order until we reached the desired total while (FoodOrders.Count != Total) { // Generate a random food order FoodTypes NewFood = GenerateFoodOrder(); // Determine if that food order has not been added to our list if (!FoodOrders.Contains(NewFood)) { FoodOrders.Add(NewFood); } } for (int i = 0; i < FoodOrders.Count; i++) { switch (FoodOrders[i]) { case FoodTypes.BREAD: { incomeFromOrder += GameManager.BreadPrice; break; } case FoodTypes.MILKSHAKE: { incomeFromOrder += GameManager.MilkshakePrice; break; } case FoodTypes.STEAK: { incomeFromOrder += GameManager.SteakPrice; break; } } } }
/// <summary> /// Verifies that any values for Food type slot in the intent is valid. /// </summary> /// <param name="FoodtypeString"></param> /// <returns></returns> private ValidationResult ValidateFoodType(string FoodTypeString) { bool isFoodTypeValid = Enum.IsDefined(typeof(FoodTypes), FoodTypeString.ToUpper()); if (Enum.TryParse(typeof(FoodTypes), FoodTypeString, true, out object FoodType)) { _chosenFoodType = (FoodTypes)FoodType; return(ValidationResult.VALID_RESULT); } else { return(new ValidationResult(false, TYPE_SLOT, String.Format("We do not have {0}, would you like a different type of food? Our most popular food is pizza, duh.", FoodTypeString))); } }
/// <summary> /// Add a food product to the current customers order /// Multiplies given food product by amount purchased and passes to /// AddToTotal_ method /// </summary> /// <param name="foodProduct"></param> ///<param name="quantity"></param> public void AddProductToOrder(FoodTypes foodProduct, int quantity) { Food food = new Food(); double foodPrice = 0.00; using var context = new joshfordproject0Context(s_dbContextOptions); IQueryable <Product> menu = context.Products .OrderBy(x => x.ProductName); foreach (Product products in menu) { if (foodProduct.ToString().Equals(products.ProductName)) { foodPrice = products.ProductPrice; } } customerFood.Add(foodProduct); AddToTotalOrderPrice(foodPrice * quantity); }
public ItemsViewModel() { Title = "Home"; Items = new ObservableCollection <Data>(); Cities = city.MainCities; LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand()); this.FoodTypes = new List <FoodType>(); FoodTypes.Add(new FoodType { description = "Vegetables" }); FoodTypes.Add(new FoodType { description = "Fruits" }); FoodTypes.Add(new FoodType { description = "Grains" }); FoodTypes.Add(new FoodType { description = "Meat and Poultry" }); FoodTypes.Add(new FoodType { description = "Fish and Seafood" }); FoodTypes.Add(new FoodType { description = "Dairy Foods" }); FoodTypes.Add(new FoodType { description = "Beverages" }); FoodTypes.Add(new FoodType { description = "Bakery" }); FoodTypes.Add(new FoodType { description = "Rice" }); FoodTypes.Add(new FoodType { description = "Sweets" }); }
public List <FoodTypes> GetFoodTypeList(string cs) { using var con = new MySqlConnection(cs); con.Open(); string sql = "CALL spGetFoodTypeList"; using var cmd = new MySqlCommand(sql, con); IList <FoodTypes> wsl = new List <FoodTypes>(); var reader = cmd.ExecuteReader(); while (reader.Read()) { var ws = new FoodTypes(); ws.FoodTypeID = reader.GetInt32("FoodTypeID"); ws.FoodTypeText = reader.GetString("FoodTypeText"); wsl.Add(ws); } reader.Close(); con.Close(); return((List <FoodTypes>)wsl); }
public FoodObjective(FoodTypes foodType) { _FoodType = foodType; }
public Food(string name, int quantity, decimal taxPercent, FoodTypes foodTypes) : base(name, quantity, taxPercent) { TypOfFood = foodTypes; }
public int GetFood(FoodTypes type) => _food[(int)type].Amount;
public void IngredientButtonPress(FoodTypes type, int slot) { dairyPanel.gameObject.SetActive(false); proteinPanel.gameObject.SetActive(false); saucePanel.gameObject.SetActive(false); starchPanel.gameObject.SetActive(false); miscPanel.gameObject.SetActive(false); TurnOnDishCategoryButtons(); switch (type) { case FoodTypes.DAIRY: dairyPanel.gameObject.SetActive(true); //Play dairy sound try { AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid(); } catch { } if (slot < 2) { TurnOffDishCategoryButtons(); } else { TurnOnDishCategoryButtons(); } break; case FoodTypes.MISC: miscPanel.gameObject.SetActive(true); //play misc sound try { AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid(); } catch { } if (slot < 2) { TurnOffDishCategoryButtons(); } else { TurnOnDishCategoryButtons(); } break; case FoodTypes.PROTEIN: proteinPanel.gameObject.SetActive(true); //play protien sound try { AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid(); } catch { } if (slot < 2) { TurnOffDishCategoryButtons(); } else { TurnOnDishCategoryButtons(); } break; case FoodTypes.SAUCE: saucePanel.gameObject.SetActive(true); //play sauce sound try { AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid(); } catch { } if (slot < 2) { TurnOffDishCategoryButtons(); } else { TurnOnDishCategoryButtons(); } break; case FoodTypes.STARCH: starchPanel.gameObject.SetActive(true); //play starch sound try { AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid(); } catch { } if (slot < 2) { TurnOffDishCategoryButtons(); } else { TurnOnDishCategoryButtons(); } break; } selectedSlot = slot; }
public override Task InitializeAsync(object navigationData) { var parameter = navigationData as Plan; if (parameter != null) { isEditing = true; ButtonText = "MODIFICAR PLAN"; plan = parameter; if (plan.Latitude != Double.NaN && plan.Longitude != Double.NaN) { pins = new ObservableCollection <Plan>(); pins.Add(plan); } RaisePropertyChanged("MinimumDate"); selectedCategory = Categories.Find(item => item.Id == plan.PlanType); RaisePropertyChanged("SelectedCategory"); RaisePropertyChanged("Name"); RaisePropertyChanged("Description"); RaisePropertyChanged("PlanDate"); RaisePropertyChanged("PlanTime"); RaisePropertyChanged("EndPlanDate"); RaisePropertyChanged("EndPlanTime"); LocationText = plan.Address; DestinationText = plan.DestinationAddress; RaisePropertyChanged("Pins"); selectedCategory = Categories.Find(item => item.Id == plan.PlanType); RaisePropertyChanged("SelectedCategory"); selectedRecommendedLevel = SkillLevels.Find(item => item.Id == plan.RecommendedLevel); RaisePropertyChanged("SelectedRecommendedLevel"); selectedLanguage1 = Languages.Find(item => item.Id == plan.Language1); RaisePropertyChanged("SelectedLanguage1"); selectedLanguage2 = Languages.Find(item => item.Id == plan.Language2); RaisePropertyChanged("SelectedLanguage2"); selectedFoodType = FoodTypes.Find(item => item.Id == plan.Language2); RaisePropertyChanged("SelectedLanguage2"); if (plan.Images.Count > 0) { Image1 = ImageSource.FromUri(new Uri(plan.Images[0].ImageFullPath)); } if (plan.Images.Count > 1) { Image2 = ImageSource.FromUri(new Uri(plan.Images[1].ImageFullPath)); } if (plan.Images.Count > 2) { Image3 = ImageSource.FromUri(new Uri(plan.Images[2].ImageFullPath)); } } return(base.InitializeAsync(navigationData)); }
public Food(FoodTypes type, Vector3 vector) { Type = type; Place = vector; }
public Food(string productid, string productname, double sellingprice, DateTime purchaseddate, int quantity, FoodTypes foodtype) : base(productid, productname, sellingprice, purchaseddate, quantity) { FoodType = foodtype; }
public static Sprite GetFoodImage(FoodTypes foodType) { return Resources.Load<Sprite>(foodType.ToString()); }
public Shopping(decimal price, CountriesEnum country, HotelTypes hotelClass, FoodTypes food) : base(price, country, hotelClass, food) { }
public static Texture GetFoodImageUI(FoodTypes foodType) { return Resources.Load<Texture>(foodType.ToString() + "UI"); }
public Hen(string name, double weight, double wingSize) : base(name, weight, wingSize) { weightGain = 0.35; foodTypesAllowed = new FoodTypes[] { FoodTypes.Meat, FoodTypes.Vegetable, FoodTypes.Seeds, FoodTypes.Fruit }; }
public void Eat(FoodTypes food) { Health = Math.Min(Health + Food.CalariesIndex[food], 100); }
public void WhenEatA(FoodTypes food) { _player.Eat(food); }
public Owl(string name, double weight, double wingSize) : base(name, weight, wingSize) { weightGain = 0.25; foodTypesAllowed = new FoodTypes[] { FoodTypes.Meat }; }
public Food(FoodTypes type, int amount) { FoodType = type; Amount = amount; }
protected Bird(string name, int age, FoodTypes food) { Name = name; Age = age; FoodType = food; }
public void AddFood(FoodTypes type, int amount) => _food[(int)type].Amount += amount;
// GET: ClientesDietas/Edit/5 public async Task <ActionResult> Edit(int id) { ViewBag.programId = id; clientes_dietas clientes_dietas = await db.clientes_dietas.Where(m => m.id == id).Include(m => m.programa_clientes).Include(m => m.dieta_diaria).FirstOrDefaultAsync(); ViewBag.clientId = clientes_dietas.programa_clientes.cliente_id; int createdOptions = clientes_dietas.dieta_diaria.OrderByDescending(d => d.opcion).Select(d => d.opcion).FirstOrDefault(); ViewBag.optionsCount = createdOptions; StringBuilder diets = new StringBuilder(); for (int opt = 0; opt < createdOptions; opt++) { StringBuilder dietsDiv = new StringBuilder(); var newDietOptionLabelRow = "<div class='row mar-bot-10'><label class='diet-title-sub'>Opción " + (opt + 1).ToString() + "</label></div>"; dietsDiv.Append(newDietOptionLabelRow); var dietDivRowId = "opt-" + opt.ToString(); var newDietDivRow = "<div id='" + dietDivRowId + "' class='row diet-row mar-bot-15'>"; dietsDiv.Append(newDietDivRow); StringBuilder dietOptionRow = new StringBuilder(); for (var i = 0; i < 7; i++) { var optColId = dietDivRowId + "-col-" + i.ToString(); if (i == 0) { var newDietColumn = "<div id='" + optColId + "' class='col-2'>"; dietOptionRow.Append(newDietColumn); } else { var newDietColumn = "<div id='" + optColId + "' class='col-2 mar-lef-10'>"; dietOptionRow.Append(newDietColumn); } StringBuilder currentColumn = new StringBuilder(); switch (i) { case 0: currentColumn.Append("<label class='diet-title'>Lun</label>"); break; case 1: currentColumn.Append("<label class='diet-title'>Mar</label>"); break; case 2: currentColumn.Append("<label class='diet-title'>Mie</label>"); break; case 3: currentColumn.Append("<label class='diet-title'>Jue</label>"); break; case 4: currentColumn.Append("<label class='diet-title'>Vie</label>"); break; case 5: currentColumn.Append("<label class='diet-title'>Sab</label>"); break; case 6: currentColumn.Append("<label class='diet-title'>Dom</label>"); break; default: break; } for (var j = 0; j < 5; j++) { var currentBoxId = optColId + "-row-" + j.ToString(); int dia = i + 1; int opc = opt + 1; FoodTypes tc = (FoodTypes)j; DailyDiet existingDiet = clientes_dietas.dieta_diaria.Where(c => c.dia == dia && c.tipo_comida == tc && c.opcion == opc).FirstOrDefault(); switch (j) { case 0: if (existingDiet != null) { currentColumn.Append("<div class='model daily-diet'><label>Desayuno</label><textarea id='" + currentBoxId + "'>" + existingDiet.texto + "</textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='" + existingDiet.id + "'/>"); } else { currentColumn.Append("<div class='model daily-diet'><label>Desayuno</label><textarea id='" + currentBoxId + "'></textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='0'/>"); } break; case 1: if (existingDiet != null) { currentColumn.Append("<div class='model daily-diet'><label>Media Mañana</label><textarea id='" + currentBoxId + "'>" + existingDiet.texto + "</textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='" + existingDiet.id + "'/>"); } else { currentColumn.Append("<div class='model daily-diet'><label>Media Mañana</label><textarea id='" + currentBoxId + "'></textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='0'/>"); } break; case 2: if (existingDiet != null) { currentColumn.Append("<div class='model daily-diet'><label>Almuerzo</label><textarea id='" + currentBoxId + "'>" + existingDiet.texto + "</textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='" + existingDiet.id + "'/>"); } else { currentColumn.Append("<div class='model daily-diet'><label>Almuerzo</label><textarea id='" + currentBoxId + "'></textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='0'/>"); } break; case 3: if (existingDiet != null) { currentColumn.Append("<div class='model daily-diet'><label>Media Tarde</label><textarea id='" + currentBoxId + "'>" + existingDiet.texto + "</textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='" + existingDiet.id + "'/>"); } else { currentColumn.Append("<div class='model daily-diet'><label>Media Tarde</label><textarea id='" + currentBoxId + "'></textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='0'/>"); } break; case 4: if (existingDiet != null) { currentColumn.Append("<div class='model daily-diet'><label>Cena</label><textarea id='" + currentBoxId + "'>" + existingDiet.texto + "</textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='" + existingDiet.id + "'/>"); } else { currentColumn.Append("<div class='model daily-diet'><label>Cena</label><textarea id='" + currentBoxId + "'></textarea></div>"); currentColumn.Append("<input type='hidden' id='opt-" + opt + "-col-" + i + "-row-" + j + "-id' value='0'/>"); } break; default: break; } } currentColumn.Append("</div>"); dietOptionRow.Append(currentColumn.ToString()); } dietOptionRow.Append("</div>"); dietsDiv.Append(dietOptionRow.ToString()); dietsDiv.Append("</div>"); diets.Append(dietsDiv.ToString()); } ViewBag.optionsHtml = diets.ToString(); return(View(clientes_dietas)); }