public ConstructInspectorViewModel(IDataGetRepository <IInspectable> currentInspectableGetRepository,
                                           IMapGetService mapGetService,
                                           IMapEditingService mapEditingService)
        {
            ConstructDataLiveData = new LiveData <ConstructData>();
            VisibilityLiveData    = new LiveData <bool>();

            _disposable = new CompositeDisposable
            {
                currentInspectableGetRepository.GetObservableStream()
                .SubscribeOn(NoobSchedulers.ThreadPool)
                .ObserveOn(NoobSchedulers.MainThread)
                .Subscribe(OnInspectableUpdate),

                mapGetService.GetObservableStream()
                .SubscribeOn(NoobSchedulers.ThreadPool)
                .ObserveOn(NoobSchedulers.MainThread)
                .Subscribe(OnNewMapCreated),

                mapEditingService.ModifiedEventStream
                .SubscribeOn(NoobSchedulers.ThreadPool)
                .ObserveOn(NoobSchedulers.MainThread)
                .Subscribe(_ => OnMapEdited())
            };
        }
        public StrongholdInspectorViewModel(IDataGetRepository <IInspectable> currentInspectableGetRepository,
                                            IMapGetService mapGetService,
                                            ILevelEditingService levelEditingService,
                                            IInGameMessageService inGameMessageService,
                                            IMapEditingService mapEditingService)
        {
            _levelEditingService   = levelEditingService;
            _inGameMessageService  = inGameMessageService;
            StrongholdDataLiveData = new LiveData <StrongholdData>();
            VisibilityLiveData     = new LiveData <bool>();

            _disposable = new CompositeDisposable
            {
                currentInspectableGetRepository.GetObservableStream()
                .SubscribeOn(NoobSchedulers.ThreadPool)
                .ObserveOn(NoobSchedulers.MainThread)
                .Subscribe(OnInspectableUpdate),

                mapGetService.GetObservableStream()
                .SubscribeOn(NoobSchedulers.ThreadPool)
                .ObserveOn(NoobSchedulers.MainThread)
                .Subscribe(OnNewMapCreated),

                mapEditingService.ModifiedEventStream
                .SubscribeOn(NoobSchedulers.ThreadPool)
                .ObserveOn(NoobSchedulers.MainThread)
                .Subscribe(_ => OnMapModified())
            };
        }
Ejemplo n.º 3
0
        public ClickStatusService(IDataGetRepository <GraphicRaycaster> graphicRaycasterGetRepository, IDataGetRepository <EventSystem> eventSystemGetRepository)
        {
            _disposable = new CompositeDisposable
            {
                graphicRaycasterGetRepository.GetObservableStream()
                .SubscribeOn(Scheduler.ThreadPool)
                .ObserveOn(Scheduler.MainThread)
                .Subscribe(raycaster => _graphicRaycaster = raycaster),

                eventSystemGetRepository.GetObservableStream()
                .SubscribeOn(Scheduler.ThreadPool)
                .ObserveOn(Scheduler.MainThread)
                .Subscribe(eventSystem => _eventSystem = eventSystem)
            };
        }