Пример #1
0
        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!");
        }
Пример #2
0
        public MainWindow()
        {
            // Application initialization (processing cmd-line, splash, ...)
            ApplicationRepository.Instance.OnStartUp();

            userInquirer = new UserInquirer(this);

            InitializeComponent();
            this.DataContext = this;
        }
Пример #3
0
        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");
        }
Пример #4
0
 public NetworkModule(IUserInquirer userInquirer)
 {
     this.userInquirer = userInquirer;
     initialize();
 }
Пример #5
0
 public void Initialize(IUserInquirer userInquirer, IGameServerCommunication gameServerCommunication)
 {
     this.userInquirer = userInquirer;
     this.gameServerCommunication = gameServerCommunication;
 }
Пример #6
0
        /// <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.");
            }
        }