public RiskBoardViewModel StartGame() { var game = new Game(new RiskBoardCreator(), new RiskArmyDelegator()); game.StartGame(); _cache.Set(CacheKey, game); var vm = ViewModelMapper.RiskBoardViewModel(game); return(vm); }
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); }