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));
 }
Esempio n. 4
0
 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));
        }
Esempio n. 6
0
		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;
			}
		}
Esempio n. 9
0
 public Trick(string name, TrickType type, ITrickable trickPerformer)
 {
     this.TrickName      = name;
     this.TrickType      = type;
     this.TrickPerformer = trickPerformer;
 }
Esempio n. 10
0
 public Trick(string trickName, TrickType trickType)
 {
     this.trickName = trickName;
     this.trickType = trickType;
 }