コード例 #1
0
        public AreaSelectorViewModel(IEventAggregator eventAggregator,
                                     IObservableDataFactory observableDataFactory,
                                     IDataDomainService dataDomainService,
                                     IObjectMapper objectMapper,
                                     IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _observableDataFactory = observableDataFactory;
            _dataDomainService     = dataDomainService;
            _objectMapper          = objectMapper;
            _moduleDataService     = moduleDataService;

            Areas = new ObservableCollectionEx <AreaDataObservable>();

            CreateAreaCommand         = new DelegateCommand(CreateArea);
            DeleteAreaCommand         = new DelegateCommand(DeleteArea);
            OpenAreaPropertiesCommand = new DelegateCommand(OpenAreaProperties);
            OpenAreaCommand           = new DelegateCommand(OpenArea);

            CreateAreaRequest         = new InteractionRequest <INotification>();
            OpenAreaPropertiesRequest = new InteractionRequest <INotification>();
            ConfirmDeleteRequest      = new InteractionRequest <IConfirmation>();


            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
            _eventAggregator.GetEvent <AreaCreatedEvent>().Subscribe(AreaCreated);
        }
コード例 #2
0
        public PlaceableEditorViewModel(
            IEventAggregator eventAggregator,
            IObservableDataFactory observableDataFactory,
            IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _observableDataFactory = observableDataFactory;
            _moduleDataService     = moduleDataService;

            NewCommand    = new DelegateCommand(New);
            DeleteCommand = new DelegateCommand(Delete);

            AddLocalStringCommand    = new DelegateCommand(AddLocalString);
            AddLocalDoubleCommand    = new DelegateCommand(AddLocalDouble);
            DeleteLocalStringCommand = new DelegateCommand <LocalStringDataObservable>(DeleteLocalString);
            DeleteLocalDoubleCommand = new DelegateCommand <LocalDoubleDataObservable>(DeleteLocalDouble);

            Placeables = new ObservableCollectionEx <PlaceableDataObservable>();
            Scripts    = new Dictionary <string, ScriptDataObservable>();

            ConfirmDeleteRequest = new InteractionRequest <IConfirmation>();

            Placeables.ItemPropertyChanged += PlaceablesOnItemPropertyChanged;

            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <DataEditorClosedEvent>().Subscribe(DataEditorClosed);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
        }
コード例 #3
0
ファイル: NewAreaViewModel.cs プロジェクト: zunath/Ceriyo
        public NewAreaViewModel(
            IEventAggregator eventAggregator,
            IObservableDataFactory observableDataFactory,
            IDataDomainService dataDomainService,
            IObjectMapper objectMapper,
            IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _observableDataFactory = observableDataFactory;
            _dataDomainService     = dataDomainService;
            _objectMapper          = objectMapper;
            _moduleDataService     = moduleDataService;

            Tilesets         = new ObservableCollectionEx <TilesetDataObservable>();
            OpenInAreaViewer = true;
            Width            = 8;
            Height           = 8;


            CreateAreaCommand = new DelegateCommand(CreateArea, CanCreateArea);
            CancelCommand     = new DelegateCommand(Cancel);

            PropertyChanged += OnPropertyChanged;

            _eventAggregator.GetEvent <DataEditorClosedEvent>().Subscribe(DataEditorClosed);
            _eventAggregator.GetEvent <ModuleOpenedEvent>().Subscribe(ModuleOpened);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
        }
コード例 #4
0
        public TilesetEditorViewModel(
            IEventAggregator eventAggregator,
            IModuleResourceService resourceDomainService,
            IObservableDataFactory observableDataFactory,
            IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _resourceDomainService = resourceDomainService;
            _observableDataFactory = observableDataFactory;
            _moduleDataService     = moduleDataService;

            NewCommand    = new DelegateCommand(New);
            DeleteCommand = new DelegateCommand(Delete);

            Tilesets           = new ObservableCollectionEx <TilesetDataObservable>();
            TilesetImages      = new ObservableCollectionEx <string>();
            ActiveTilesetImage = new BitmapImage();

            ConfirmDeleteRequest          = new InteractionRequest <IConfirmation>();
            Tilesets.ItemPropertyChanged += TilesetsOnItemPropertyChanged;

            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <DataEditorClosedEvent>().Subscribe(DataEditorClosed);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
        }
コード例 #5
0
        public ScriptSelectorViewModel(
            IEventAggregator eventAggregator,
            IModuleDataService moduleDataService,
            IObservableDataFactory observableDataFactory,
            IDataDomainService dataDomainService,
            IObjectMapper objectMapper)
        {
            _eventAggregator       = eventAggregator;
            _moduleDataService     = moduleDataService;
            _observableDataFactory = observableDataFactory;
            _dataDomainService     = dataDomainService;
            _objectMapper          = objectMapper;

            CreateScriptCommand = new DelegateCommand(CreateScript);
            DeleteScriptCommand = new DelegateCommand(DeleteScript);
            EditScriptCommand   = new DelegateCommand(EditScript);

            CreateScriptRequest  = new InteractionRequest <INotification>();
            EditScriptRequest    = new InteractionRequest <INotification>();
            ConfirmDeleteRequest = new InteractionRequest <IConfirmation>();


            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
            _eventAggregator.GetEvent <ScriptCreatedEvent>().Subscribe(ScriptCreated);

            Scripts = new ObservableCollectionEx <ScriptDataObservable>();
        }
コード例 #6
0
        public AreaPropertiesViewModel(
            IEventAggregator eventAggregator,
            IObservableDataFactory observableDataFactory,
            IDataDomainService dataDomainService,
            IObjectMapper objectMapper,
            IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _observableDataFactory = observableDataFactory;
            _dataDomainService     = dataDomainService;
            _objectMapper          = objectMapper;
            _moduleDataService     = moduleDataService;

            Tilesets       = new ObservableCollectionEx <TilesetDataObservable>();
            LocalVariables = new LocalVariableDataObservable();

            SaveCommand              = new DelegateCommand(Save);
            CancelCommand            = new DelegateCommand(Cancel);
            AddLocalDoubleCommand    = new DelegateCommand(AddLocalDouble);
            AddLocalStringCommand    = new DelegateCommand(AddLocalString);
            DeleteLocalDoubleCommand = new DelegateCommand <LocalDoubleDataObservable>(DeleteLocalDouble);
            DeleteLocalStringCommand = new DelegateCommand <LocalStringDataObservable>(DeleteLocalString);

            _eventAggregator.GetEvent <AreaPropertiesOpenedEvent>().Subscribe(AreaPropertiesOpened);
            _eventAggregator.GetEvent <ModuleOpenedEvent>().Subscribe(ModuleOpened);
            _eventAggregator.GetEvent <DataEditorClosedEvent>().Subscribe(DataEditorClosed);
        }
コード例 #7
0
 public MainWindowViewModel(IModuleDataService moduleDataService)
 {
     this.moduleDataService = moduleDataService;
     LocatePDFCommand       = new RelayCommand(LocatePDF, CanLocatePDF);
     ExtractDataCommand     = new RelayCommand(ExtractData, CanExtractData);
     GenerateCSVCommand     = new RelayCommand(GenerateCSV, CanGenerateCSV);
 }
コード例 #8
0
ファイル: Area.cs プロジェクト: zunath/Ceriyo
 /// <summary>
 /// Constructs a new area object.
 /// </summary>
 /// <param name="factory">The component factory used for creating components.</param>
 /// <param name="moduleDataService">The module data service used for loading data from the module.</param>
 /// <param name="resourceService">The resource service used for loading content files from resource packs.</param>
 public Area(IComponentFactory factory,
             IModuleDataService moduleDataService,
             IModuleResourceService resourceService)
 {
     _factory           = factory;
     _moduleDataService = moduleDataService;
     _resourceService   = resourceService;
 }
コード例 #9
0
ファイル: ClassEditorViewModel.cs プロジェクト: zunath/Ceriyo
        public ClassEditorViewModel(
            IEventAggregator eventAggregator,
            IObservableDataFactory observableDataFactory,
            IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _observableDataFactory = observableDataFactory;
            _moduleDataService     = moduleDataService;

            NewCommand    = new DelegateCommand(New);
            DeleteCommand = new DelegateCommand(Delete);

            Classes = new ObservableCollectionEx <ClassDataObservable>();

            ConfirmDeleteRequest = new InteractionRequest <IConfirmation>();

            Classes.ItemPropertyChanged += ClassesOnItemPropertyChanged;

            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <DataEditorClosedEvent>().Subscribe(DataEditorClosed);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
        }
コード例 #10
0
 public ServerScreen(EntityWorld world,
                     IEntityFactory entityFactory,
                     IServerNetworkService networkService,
                     IModuleService moduleService,
                     IModuleDataService moduleDataService,
                     IScriptService scriptService,
                     IDataService dataService,
                     IPathService pathService,
                     ILogger logger,
                     IServerSettingsService settingsService)
 {
     _world             = world;
     _entityFactory     = entityFactory;
     _networkService    = networkService;
     _moduleService     = moduleService;
     _moduleDataService = moduleDataService;
     _scriptService     = scriptService;
     _dataService       = dataService;
     _pathService       = pathService;
     _logger            = logger;
     _settingsService   = settingsService;
 }
コード例 #11
0
ファイル: AreaEditorScreen.cs プロジェクト: zunath/Ceriyo
        public AreaEditorScreen(IEventAggregator eventAggregator,
                                IEntityFactory entityFactory,
                                IObjectMapper objectMapper,
                                IModuleDataService moduleDataService,
                                IEngineService engineService,
                                Camera2D camera)
        {
            _eventAggregator   = eventAggregator;
            _entityFactory     = entityFactory;
            _objectMapper      = objectMapper;
            _camera            = camera;
            _moduleDataService = moduleDataService;
            _engineService     = engineService;

            _eventAggregator.GetEvent <AreaOpenedEvent>().Subscribe(AreaOpened);
            _eventAggregator.GetEvent <AreaClosedEvent>().Subscribe(AreaClosed);
            _eventAggregator.GetEvent <CameraMovedEvent>().Subscribe(CameraMoved);
            _eventAggregator.GetEvent <CameraZoomedEvent>().Subscribe(CameraZoomed);
            _eventAggregator.GetEvent <CameraResetEvent>().Subscribe(CameraReset);
            _eventAggregator.GetEvent <AreaPropertiesChangedEvent>().Subscribe(AreaPropertiesChanged);
            _eventAggregator.GetEvent <TileSelectedEvent>().Subscribe(TileSelected);
        }
コード例 #12
0
        public TileSelectorViewModel(IEventAggregator eventAggregator,
                                     IModuleDataService moduleDataService,
                                     IModuleResourceService resourceService,
                                     IEngineService engineService)
        {
            _eventAggregator   = eventAggregator;
            _moduleDataService = moduleDataService;
            _resourceService   = resourceService;
            _engineService     = engineService;
            TileGridVisibility = Visibility.Hidden;

            SelectedTileBrush      = Brushes.Yellow;
            SelectedTileHeight     = _engineService.TileHeight;
            SelectedTileWidth      = _engineService.TileWidth;
            SelectedTileVisibility = Visibility.Visible;
            SelectedTileX          = 0;
            SelectedTileY          = 0;

            CellSelectedCommand = new DelegateCommand <MouseButtonEventArgs>(CellSelected);

            _eventAggregator.GetEvent <AreaOpenedEvent>().Subscribe(AreaOpened);
            _eventAggregator.GetEvent <AreaClosedEvent>().Subscribe(AreaClosed);
        }