public void AddItem(Item.Name name, Item.StateOfIncision stateOfIncision, Item.StateOfPreparing stateOfPreparing, bool isBreaded) { for (int i = 0; i < Slots.Count; i++) { if (Slots[i] == null) { Slots[i] = _database.Generate(name, stateOfIncision, stateOfPreparing, isBreaded); break; } } }
void Start() { _db = GameObject.FindGameObjectWithTag("ItemDataBase").GetComponent <ItemDataBase>(); Receipe recipe1 = new Receipe() { Ingridients = new List <Item>() { new Item(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false), new Item(Item.Name.Bread, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false), }, Result = _db.Generate(Item.Name.Sandwich, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false) }; Receipe recipe2 = new Receipe() { Ingridients = new List <Item>() { new Item(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false), new Item(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false) }, Result = _db.Generate(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Fried, false) }; Receipes = new List <Receipe>() { recipe1, recipe2 }; }
public void AddtoRepository(int quantity, Item.Name type) { for (int i = 0; i < _items.Length; i++) { if (_items[i] == null) { if (quantity > 0) { _items[i] = _db.Generate(_storedItemType, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false); if (_isEmpty) { _isEmpty = false; } quantity--; } } } }