public void Update(float elapsedMilliseconds) { // update network and the turn game _networkContext.Update(); _turnGame.Update(elapsedMilliseconds); // try to update the game List <IGameCommand> commands; if (_turnGame.TryUpdate(out commands)) { _gameEngine.Update(commands.Cast <IGameInput>()).Wait(); _gameEngine.SynchronizeState().Wait(); _gameEngine.DispatchEvents(); } }
public IActionResult Accept(int id) { Connection connect; try { connect = _context.Connections.Include(conn => conn.ConnectedTo).Include(conn => conn.Connector).Single(conn => conn.ConnectionId == id); } catch { return(RedirectToAction("Profile")); } if (connect.ConnectedToId != (int)HttpContext.Session.GetInt32("currUser")) { return(RedirectToAction("Profile")); } connect.Accepted = 1; _context.Update(connect); _context.SaveChanges(); return(RedirectToAction("Profile")); }
public void Update() { _context.Update(); }