Exemplo n.º 1
0
        public RiskBoardViewModel StartGame()
        {
            var game = new Game(new RiskBoardCreator(), new RiskArmyDelegator());

            game.StartGame();

            _cache.Set(CacheKey, game);

            var vm = ViewModelMapper.RiskBoardViewModel(game);

            return(vm);
        }
Exemplo n.º 2
0
        public RiskBoardViewModel Play()
        {
            var game = _cache.Get <Game>(CacheKey);

            if (game.GamePhase == GamePhase.Claim || game.GamePhase == GamePhase.Place)
            {
                game.FastForwardCurrentPhase();
            }
            else
            {
                game.PlayTurn();
            }

            _cache.Set("RiskGame", game);

            var vm = ViewModelMapper.RiskBoardViewModel(game);

            return(vm);
        }