Ejemplo n.º 1
0
        public static GameState.GameStateClass GetGameState(HttpContext httpContext)
        {
            var gameState = httpContext.Session.Get <GameState.GameStateClass>(SessionKeyGameState);

            if (gameState == null)
            {
                gameState = GameStateFactory.GenerateNewGameState();
                httpContext.Session.Set <GameState.GameStateClass>(SessionKeyGameState, gameState);
            }

            return(gameState);
        }