public Game IncludeNewGame(Game gd) { int i = Games.Count; gd.Codigo = i + 1; Games.Add(gd); return gd; }
public ActionResult CriaNovaPartida(string nome) { Jogador online = Session["online"] as Jogador; if (online == null) { return RedirectToAction("Login"); } Jogador adversario = dBase.GetByName(nome); Game game = new Game(online.Code, adversario.Code); sendGame sd = new sendGame(); sd.jogo = dBase.IncludeNewGame(game); sd.online = online; return View(sd); }