public IHttpActionResult PutINGREDIENT_TYPE(int id, INGREDIENT_TYPE iNGREDIENT_TYPE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iNGREDIENT_TYPE.INGREDIENT_TYPE_ID) { return(BadRequest()); } db.Entry(iNGREDIENT_TYPE).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!INGREDIENT_TYPEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetINGREDIENT_TYPE(int id) { INGREDIENT_TYPE iNGREDIENT_TYPE = db.INGREDIENT_TYPE.Find(id); if (iNGREDIENT_TYPE == null) { return(NotFound()); } return(Ok(iNGREDIENT_TYPE)); }
public IHttpActionResult PostINGREDIENT_TYPE(INGREDIENT_TYPE iNGREDIENT_TYPE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.INGREDIENT_TYPE.Add(iNGREDIENT_TYPE); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = iNGREDIENT_TYPE.INGREDIENT_TYPE_ID }, iNGREDIENT_TYPE)); }
public IHttpActionResult DeleteINGREDIENT_TYPE(int id) { INGREDIENT_TYPE iNGREDIENT_TYPE = db.INGREDIENT_TYPE.Find(id); if (iNGREDIENT_TYPE == null) { return(NotFound()); } db.INGREDIENT_TYPE.Remove(iNGREDIENT_TYPE); db.SaveChanges(); return(Ok(iNGREDIENT_TYPE)); }
static public Ingredient Grab(INGREDIENT_TYPE ingredientType) { Ingredient retVal = null; if (!m_spawnLists.ContainsKey(ingredientType)) { return(retVal); } if (m_spawnLists[ingredientType].Count > 1) { int index = 1; retVal = m_spawnLists[ingredientType][index]; m_spawnLists[ingredientType].RemoveAt(index); } else { retVal = Instantiate(m_spawnLists[ingredientType][0]); } if (retVal.m_grabbedByPlayer) { Debug.Log("What the?"); } if (retVal != null) { retVal.InstanceInit(); retVal.gameObject.SetActive(true); retVal.ActivateCollision(false); retVal.transform.SetParent(null); retVal.transform.localScale = m_spawnLists[ingredientType][0].transform.localScale; } if (!SanityCheck(retVal)) { Debug.Log("On my ever living..."); } return(retVal); }
public string GetText(INGREDIENT_TYPE ingredient) { switch (ingredient) { case INGREDIENT_TYPE.ANCHOVIES: return names[0]; case INGREDIENT_TYPE.BACON: return names[1]; case INGREDIENT_TYPE.EXTRA_CHEESE: return names[2]; case INGREDIENT_TYPE.MUSHROOM: return names[3]; case INGREDIENT_TYPE.OLIVES: return names[4]; case INGREDIENT_TYPE.PEPPER: return names[5]; case INGREDIENT_TYPE.PEPPERONI: return names[6]; case INGREDIENT_TYPE.PINEAPPLE: return names[7]; default: Debug.Log("Could not find a matching ingredient type--text not found"); return null; } }
public void SetType(INGREDIENT_TYPE other) { this.type = other; }
static public uint BitMask(INGREDIENT_TYPE ingredientType) { return((uint)(1 << (int)ingredientType)); }