public WaitingOnOtherPlayerForm(OnlineServer server, int sessionid, string currentPlayerId) { _server = server; _sessionid = sessionid; _currentPlayerId = currentPlayerId; InitializeComponent(); tmrMove.Interval = 2000; tmrMove.Tick += new EventHandler(tmrMove_Tick); tmrMove.Start(); }
/// <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); }