public IHttpActionResult PutMoviments(int id, Moviments moviments) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != moviments.Id) { return(BadRequest()); } db.Entry(moviments).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MovimentsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
void Start() { moviments = new Moviments(); life = new Life(3); sprite = GetComponent <SpriteRenderer>(); rigidbody = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); }
public void Start() { moviments = new Moviments(); life = new Life(1); sprite = GetComponent <SpriteRenderer>(); rigidbody = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); horizontal = 1; }
public IHttpActionResult GetMoviments(int id) { Moviments moviments = db.Moviments.Find(id); if (moviments == null) { return(NotFound()); } return(Ok(moviments)); }
public IHttpActionResult PostMoviments(Moviments moviments) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Moviments.Add(moviments); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = moviments.Id }, moviments)); }
public IHttpActionResult DeleteMoviments(int id) { Moviments moviments = db.Moviments.Find(id); if (moviments == null) { return(NotFound()); } db.Moviments.Remove(moviments); db.SaveChanges(); return(Ok(moviments)); }
private void Start() { move = GameObject.FindGameObjectWithTag("Mario").GetComponent <IMove>(); moviments = GameObject.FindGameObjectWithTag("Mario").GetComponent <MarioController>().moviments; }