public string BeanTypeToString(BeanType bt) { switch (bt) { case BeanType.BT_BASIC: return("Basic Blend (B)"); case BeanType.BT_BLUE_MOUNTAIN: return("Blue Mountain (Triangle Shape)"); case BeanType.BT_HOT_COCOA: return("Hot Cocoa (Chocolate Bar)"); case BeanType.BT_HOUSE_BLEND: return("House Blend (Sparkles)"); case BeanType.BT_KILIMANJARO: return("Kilimanjaro (K)"); case BeanType.BT_MOCHA: return("Mocha (M)"); default: return("idk"); } }
public override void ClearModifiedPropertyNames(object bean) { if (HasClearModifiedPropertyNamesMethodName) { MethodInfo mi = BeanType.GetMethod(ClearModifiedPropertyNamesMethodName); mi.Invoke(bean, null); } else if (HasModifiedPropertyNamesPropertyName) { PropertyInfo pi = BeanType.GetProperty(ModifiedPropertyNamesPropertyName); IDictionary modifiedPropertyNames = (IDictionary)pi.GetValue(bean, null); modifiedPropertyNames.Clear(); } }
public override IDictionary GetModifiedPropertyNames(object bean) { String propertyName = _modifiedPropertyNamesPropertyName; if (!HasModifiedPropertyNamesPropertyName) { throw new NotFoundModifiedPropertiesRuntimeException(bean.GetType().Name, propertyName); } PropertyInfo modifiedPropertyType = BeanType.GetProperty(propertyName); object value = modifiedPropertyType.GetValue(bean, null); IDictionary names = (IDictionary)value; return(names); }
public void AddItemBean(ItemBean item, BeanType type) { itemBeanList.Add(item); if (type == BeanType.main) { mainBeanList.Add(item); } else if (type == BeanType.support) { optionBeanList.Add(item); } else if (type == BeanType.sugar) { sugarBean = item; } }
/** * @brief Unlocks a certain item * @param itemType The type of item to unlock * @param item The index of the item that will be unlocked, must cast enum to int */ public void UnlockItem(ItemType itemType, int item) { switch (itemType) { case ItemType.Item_BEAN: BeanType beanType = (BeanType)item; if (unlockedBeans.ContainsKey(beanType)) { unlockedBeans[beanType] = true; justUnlockedText.text = "Unlocked: " + BeanTypeToString(beanType); } break; case ItemType.Item_MILK: MilkType milkType = (MilkType)item; if (unlockedMilk.ContainsKey(milkType)) { unlockedMilk[milkType] = true; justUnlockedText.text = "Unlocked: " + MilkTypeToString(milkType); } break; case ItemType.Item_FLAVOR_SHOT: FlavorShot f = (FlavorShot)item; if (unlockedFlavors.ContainsKey(f)) { unlockedFlavors[f] = true; justUnlockedText.text = "Unlocked: " + FlavorTypeToString(f); } break; case ItemType.Item_TOPPING: ToppingType t = (ToppingType)item; if (unlockedToppings.ContainsKey(t)) { unlockedToppings[t] = true; justUnlockedText.text = "Unlocked: " + ToppingTypeToString(t); } break; default: break; } }
public void StartOrder() { numToppingsToOrder = Random.Range(0, 3); order = GameManager.Instance.GenerateOrder(numToppingsToOrder); orderBeans = order.beanType; orderMilk = order.milkType; orderSugar = order.sugarAmount; orderFlavor = order.flavor; orderToppings = order.toppings; numToppingsToOrder = orderToppings.Count; while (orderToppings.Contains(ToppingType.Topping_NONE)) { orderToppings.Remove(ToppingType.Topping_NONE); numToppingsToOrder = orderToppings.Count; } inUse = true; customerObject.SetActive(true); orderQuip = CreateOrderString(); }
void OnTriggerEnter2D(Collider2D other) { if (!isBrewing) { if (other.gameObject.tag == "Bean") { Item item = other.gameObject.GetComponent <Item>(); if (item != null) { //GameObject obj = Instantiate(coffeeObject, coffeeSpawnPosition, transform.rotation); //Coffee coffeeComponent = obj.GetComponent<Coffee>(); //coffeeComponent.SetBeanType(item.GetBeanType()); nextBeanType = item.GetBeanType(); isBrewing = true; Destroy(other.gameObject); } } } }
public void SetBeanType(BeanType bean) { beanType = bean; }
public Beans(int amountInG, BeanType sort) { this.amountInG = amountInG; this.Sort = sort; }