public NetworkModule(IConnection networkConnection, Game gameOpponent, IUserInquirer userInquirer) { initialize(); this.networkConnection = networkConnection; this.gameOpponent = gameOpponent; this.userInquirer = userInquirer; if (gameOpponent == null) throw new InvalidStateException("NetworkModule: Opponent is not set!"); }
public MainWindow() { // Application initialization (processing cmd-line, splash, ...) ApplicationRepository.Instance.OnStartUp(); userInquirer = new UserInquirer(this); InitializeComponent(); this.DataContext = this; }
public Game(IQuest quest, GameMode gameMode, GameDisplayType gameDisplayType, INetworkService networkService, IUserInquirer userInquirer) { this.quest = quest; this.gameDisplayType = gameDisplayType; this.gameMode = gameMode; this.networkService = networkService; this.userInquirer = userInquirer; if (this.quest == null) throw new NotValidQuestException("Quest is not valid"); }
public NetworkModule(IUserInquirer userInquirer) { this.userInquirer = userInquirer; initialize(); }
public void Initialize(IUserInquirer userInquirer, IGameServerCommunication gameServerCommunication) { this.userInquirer = userInquirer; this.gameServerCommunication = gameServerCommunication; }
/// <summary> /// /// </summary> /// <param name="path">Absolute path to the directory with solvers</param> /// <param name="parentWindow">We need to display dialogs and the dialogs need to be bound to a window; main window reference is expected</param> public void Initialize(ISolverProvider solverProvider, Window parentWindow, IErrorMessagesPresenter errorPresenter, IUserInquirer userInquirer, IGameServerCommunication gameServerCommunication) { this.errorPresenter = errorPresenter; this.gameServerCommunication = gameServerCommunication; this.userInquirer = userInquirer; this.solverProvider = solverProvider; solversManager = new SolversManager(solverProvider, parentWindow); // Register callback solversManager.RegisterStatusChangeCallback(solverStatusChange); SolversList = new ObservableCollection<string>(solversManager.Solvers); // we want to notify CurrentSolver = solversManager.CurrentSolver; solverPainter = solverProvider as ISolverPainter; if (solverPainter == null) { throw new Exception("Reference `solverProvider' should also implement ISolverPainter."); } }