Exemplo n.º 1
0
        public void NewGame(NewGame model)
        {
            var session = new Session(model.SessionName, model.BoardSize, model.WinCondition, model.Timer);
            session.Users.Add(Clients.Caller);
            GameManager.ActiveSessions.Add(session);

            var vm = new SessionViewModel
            {
                SessionID = session.SessionID,
                SessionName = model.SessionName,
                PlayerIndex = 1,
                BoardSize = model.BoardSize,
                Timer = model.Timer
            };

            Clients.Caller.buildBoard(vm);
            vm.PlayerIndex = 0;
            Clients.Others.addSession(vm);
        }
Exemplo n.º 2
0
 public static void AddSession(Session session)
 {
     GameManager.ActiveSessions.Add(session);
 }