/********* ** Public Methods *********/ /// <summary>Constructs an instance.</summary> /// <param name="objectId">The id of the outerwear object.</param> /// <param name="type">The type of outerwear.</param> /// <param name="effects">The effects the outerwear has when equipped.</param> /// <param name="equippedTexture">The spritesheet of the outerwear on the farmer when it's equipped.</param> public OuterwearData(int objectId, OuterwearType type, OuterwearEffects effects, Texture2D equippedTexture) { ObjectId = objectId; Type = type; Effects = effects ?? new OuterwearEffects(); EquippedTexture = equippedTexture; }
public ActionResult DeleteConfirmed(int id) { OuterwearType outerwearType = db.OuterwearTypes.Find(id); db.OuterwearTypes.Remove(outerwearType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OuterwearTypeID,OuterwearTypeName")] OuterwearType outerwearType) { if (ModelState.IsValid) { db.Entry(outerwearType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(outerwearType)); }
public ActionResult Create([Bind(Include = "OuterwearTypeID,OuterwearTypeName")] OuterwearType outerwearType) { if (ModelState.IsValid) { db.OuterwearTypes.Add(outerwearType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(outerwearType)); }
// GET: OuterwearTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OuterwearType outerwearType = db.OuterwearTypes.Find(id); if (outerwearType == null) { return(HttpNotFound()); } return(View(outerwearType)); }