Exemplo n.º 1
0
        /// <summary>
        /// Sets up eithr a local game or online game
        /// </summary>
        /// <param name="onlinePlay"></param>
        /// <returns></returns>
        private IGame SetupGame(bool onlinePlay)
        {
            //setup board manager
            _boardManager = new BoardManager(_dbDoc);

            //clear the board
            _boardManager.ClearBoard();

            if (onlinePlay)
            {
                string currentUser = Environment.UserName;
                RestfulCommunicator restfulCommunicator = new RestfulCommunicator();
                OnlineServer server = new OnlineServer(restfulCommunicator);
                return new OnlineGame(_uiDoc, _boardManager, _scoreKeeper, server, currentUser);
            }

            return new LocalGame(_uiDoc, _boardManager, _scoreKeeper);
        }
Exemplo n.º 2
0
 public OnlineServer(RestfulCommunicator communicator)
 {
     _restfulCommunicator = communicator;
 }