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())
            };
        }
Exemplo n.º 2
0
 private void Initialize()
 {
     _gameEnvironmentSetRepository     = selectedGameEnvironmentRepositoryProvider.Provide();
     _tileHoldersFetchingService       = tileHoldersFetchingServiceProvider.Provide();
     _unitHoldersFetchingService       = unitHoldersFetchingServiceProvider.Provide();
     _constructHoldersFetchingService  = constructsHoldersFetchingServiceProvider.Provide();
     _strongholdHoldersFetchingService = strongholdHolderFetchingServiceProvider.Provide();
     _messageService = messageServiceProvider.Provide();
 }
Exemplo n.º 3
0
        public SaveViewModel(ISaveEnvironmentService saveEnvironmentService,
                             IGameEnvironmentGetRepository loadedGameEnvironmentGetRepository,
                             IInGameMessageService messageService)
        {
            _saveEnvironmentService             = saveEnvironmentService;
            _saveEnvironmentService             = saveEnvironmentService;
            _loadedGameEnvironmentGetRepository = loadedGameEnvironmentGetRepository;
            _messageService = messageService;

            savingResultEvent = new LiveData <SavingResult>();
            savingDetailDialogVisibilityEvent = new LiveData <bool>();
        }
Exemplo n.º 4
0
        public DebugLogMessageViewModel(IInGameMessageService messageService)
        {
            _messageService = messageService;
            MessageLiveData = new LiveData <string>();

            _disposable = messageService.InGameEditorUiMessageStream
                          .SubscribeOn(Scheduler.ThreadPool)
                          .ObserveOn(Scheduler.MainThread)
                          .Subscribe(
                message => MessageLiveData.PostValue(message.Value)
                );
        }
Exemplo n.º 5
0
 private void OnEnable()
 {
     _commandExecutionService = commandExecutionServiceProvider.Provide();
     _inGameMessageService    = inGameMessageServiceProvider.Provide();
 }