Пример #1
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            //setup class variables
            _dbDoc = commandData.Application.ActiveUIDocument.Document;
            _uiDoc = commandData.Application.ActiveUIDocument;

            //setup ScoreKeeper
            _scoreKeeper = new ScoreKeeper(_dbDoc);

            //Find out which game to play
            NewGameMenu menu = new NewGameMenu();
            DialogResult result = menu.ShowDialog();

            //check if they want to reset the scores
            //using a dialog result of No to trigger this.
            if (result == DialogResult.No)
            {
                _scoreKeeper.ResetScores();
                return Result.Succeeded;
            }

            if (result != DialogResult.OK)
                return Result.Cancelled;

            //setup the game
            IGame game = SetupGame(menu.IsOnlineGame());

            //run the game
            game.StartGame();

            return Result.Succeeded;
        }
Пример #2
0
 public LocalGame(UIDocument uiDoc, BoardManager boardManager, ScoreKeeper scoreKeeper )
 {
     _uiDoc = uiDoc;
     _boardManager = boardManager;
     _scoreKeeper = scoreKeeper;
 }