public ActionResult DeleteConfirmed(int id) { TrickType trickType = db.TrickTypes.Find(id); db.TrickTypes.Remove(trickType); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool MatchStrings(TrickType type) { Challenge c = new Challenge(); if (c.Type.Equals(type)) { return(true); } return(false); }
public ActionResult Edit([Bind(Include = "TrickTypeID,TrickName")] TrickType trickType) { if (ModelState.IsValid) { db.Entry(trickType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trickType)); }
public ReactionType ReactToTrick(TrickType type) { if (type == TrickType.ACROBATIE) { return(ReactionType.APPLAUDIT); } else { return(ReactionType.SIFFLE); } }
public ActionResult Create([Bind(Include = "TrickTypeID,TrickName")] TrickType trickType) { if (ModelState.IsValid) { db.TrickTypes.Add(trickType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trickType)); }
public Trick(string name = "", TrickType type = 0, string description = "", bool switchStance = false, sbyte halfRotations = 0, Flip flips = new Flip(), bool cleared = false, bool confirmed = false) { Name = name; Type = type; Description = description; SwitchStance = switchStance; HalfRotations = halfRotations; Flips = flips; Cleared = cleared; Confirmed = confirmed; }
// GET: TrickTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrickType trickType = db.TrickTypes.Find(id); if (trickType == null) { return(HttpNotFound()); } return(View(trickType)); }
private bool IsListEmpty(TrickType TricksToUse) { IEnumerable<Trick> query = from trick in Data.TricksList where TricksToUse == TrickType.Custom || trick.Type == TricksToUse orderby trick.Name select trick; if (TricksToUse == (TrickType)7) { query = from trick in Data.TricksList where trick.RecommendedRank == (Rank)Arguments.GetInt("Rank") select trick; } var TricksList = query.ToArray(); var flattenedRanksTricks = Data.RanksTricks.Flatten(); var filteredTricksList = from trick in TricksList where !flattenedRanksTricks.Any((t) => t.Name == trick.Name) select trick; if (filteredTricksList.Count<Trick>() == 0) { return true; } else { return false; } }
public Trick(string name, TrickType type, ITrickable trickPerformer) { this.TrickName = name; this.TrickType = type; this.TrickPerformer = trickPerformer; }
public Trick(string trickName, TrickType trickType) { this.trickName = trickName; this.trickType = trickType; }