public ActionResult StartNewSubmit(Game game) { using (var db = Context.GameContext.Create()) { if (User != null && !string.IsNullOrEmpty(User.Identity.Name)) { var user = db.Users.First(F => F.Name == User.Identity.Name); game.User = user; } State start = new State(); start.VertexName = "Start_Initial"; start.Game = game; start.DateTime = new DateTime(2016, 1, 1); start.ShowDelta = true; start.ShowDebug = false; start.EdgeName = ""; start.Title = "Escalation"; start.CurrentState = true; game.States.Add(start); db.Games.Add(game); db.SaveChanges(); } Session["Game"] = game; return RedirectToAction("Index", "Game"); }
public Edge(GraphData d) { State = GraphHelper.ShallowCopyEntity(d.Start); }
public static Vertex GetVertex(State s) { return GetVertex(s.VertexName, new GraphData() { Game = s.Game, Start = s }); }