Exemple #1
0
 public CargoStorageVM(StaticDataStore staticData, CommandReferences cmdRef, CargoStorageDB storeDB)
 {
     _staticData      = staticData;
     _storageDatablob = storeDB;
     CmdRef           = cmdRef;
     Update();
 }
Exemple #2
0
        public ColonyScreenVM(GameVM gameVM, Entity colonyEntity, StaticDataStore staticData)
        {
            gameVM.Game.GameLoop.GameGlobalDateChangedEvent += GameVM_DateChangedEvent;
            _colonyEntity = colonyEntity;
            _facilities   = new ObservableCollection <FacilityVM>();
            ComponentInstancesDB instaces = colonyEntity.GetDataBlob <ComponentInstancesDB>();

            foreach (var installation in instaces.SpecificInstances)
            {
                //Facilities.Add(new FacilityVM(installation.Key, instaces));
                FacilitesList.Add(new ComponentSpecificDesignVM(installation.Key, installation.Value));
            }


            UpdatePop();

            CommandReferences cmdRef = new CommandReferences(FactionEntity.Guid, _colonyEntity.Guid, gameVM.Game.OrderHandler, _colonyEntity.Manager.ManagerSubpulses);

            CargoStoreVM = new CargoStorageVM(staticData, cmdRef, colonyEntity.GetDataBlob <CargoStorageDB>());

            PlanetMineralDepositVM = new PlanetMineralDepositVM(staticData, _colonyEntity.GetDataBlob <ColonyInfoDB>().PlanetEntity);

            RefineryAbilityVM = new RefineryAbilityVM(staticData, _colonyEntity);

            ConstructionAbilityVM = new ConstructionAbilityVM(staticData, _colonyEntity);

            ColonyResearchVM = new ColonyResearchVM(staticData, _colonyEntity);
        }
Exemple #3
0
 internal RefineJobVM(RefiningVM parentVM, StaticDataStore staticData, RefineingJob job, CommandReferences cmdRef)
 {
     _parent     = parentVM;
     _staticData = staticData;
     JobItem     = job;
     Item        = _staticData.CargoGoods.GetMaterial(JobItem.ItemGuid).Name;
     _cmdRef     = cmdRef;
 }
Exemple #4
0
 internal RefineJobVM(RefiningVM parentVM, StaticDataStore staticData, RefineingJob job, CommandReferences cmdRef)
 {
     _parent     = parentVM;
     _staticData = staticData;
     JobItem     = job;
     Item        = _staticData.ProcessedMaterials[JobItem.ItemGuid].Name;
     _cmdRef     = cmdRef;
 }
 public TranslationMoveVM(Game game, CommandReferences cmdRef, Entity entity)
 {
     _tMoveDB = entity.GetDataBlob <TranslateMoveDB>();
     _posDB   = entity.GetDataBlob <PositionDB>();
     _propDB  = entity.GetDataBlob <PropulsionDB>();
     _cmdRef  = cmdRef;
     TargetList.SelectionChangedEvent += OnTargetSelectonChange;
     UpdateTargetList(entity.GetDataBlob <OwnedDB>().OwnedByFaction, entity.Manager);
 }
        public TranslationMoveVM(Game game, CommandReferences cmdRef, Entity entity)
        {
            _tMoveDB = entity.GetDataBlob <TranslateMoveDB>();
            _posDB   = entity.GetDataBlob <PositionDB>();
            _propDB  = entity.GetDataBlob <PropulsionAbilityDB>();
            _cmdRef  = cmdRef;
            TargetList.SelectionChangedEvent += OnTargetSelectonChange;
            Entity faction;

            entity.Manager.FindEntityByGuid(entity.FactionOwner, out faction);
            UpdateTargetList(faction, entity.Manager);
        }
Exemple #7
0
        private void OnEntitySelected(int oldindex, int newindex)
        {
            Viewmodels.Clear();
            _viewmodelDict.Clear();
            Guid key = SelectableEntites.GetKey(newindex);

            _entity   = _selectableEntitys[key];
            CmdRef    = new CommandReferences(_entity.FactionOwner, _entity.Guid, _game.OrderHandler, _entity.Manager.ManagerSubpulses);
            HasEntity = true;
            _entity.Manager.ManagerSubpulses.SystemDateChangedEvent += OnSystemDateChange;
            Update();
        }
Exemple #8
0
 public RefiningVM(Game game, CommandReferences cmdRef, RefiningDB refiningDB)
 {
     _staticData   = game.StaticData;
     _refineDB     = refiningDB;
     _orderHandler = game.OrderHandler;
     _factionGuid  = refiningDB.OwningEntity.FactionOwner;
     _cmdRef       = cmdRef;
     foreach (var kvp in _staticData.CargoGoods.GetMaterials())
     {
         ItemDictionary.Add(kvp.Key, kvp.Value.Name);
     }
     ItemDictionary.SelectedIndex = 0;
     NewJobBatchCount             = 1;
     NewJobRepeat = false;
 }
Exemple #9
0
 public IDBViewmodel CreateVM(Game game, CommandReferences cmdRef)
 {
     return(new RefiningVM(game, cmdRef, this));
 }
 IDBViewmodel ICreateViewmodel.CreateVM(Game game, CommandReferences cmdRef)
 {
     return(new CargoStorageVM(game.StaticData, cmdRef, this));
 }
Exemple #11
0
 internal CargoStorageVM(StaticDataStore staticData, CommandReferences cmdRef, CargoStorageDB storeDB)
 {
     _staticData      = staticData;
     _storageDatablob = storeDB;
     Update();
 }
Exemple #12
0
 public IDBViewmodel CreateVM(Game game, CommandReferences cmdRef)
 {
     return(new TranslationMoveVM(game, cmdRef, this.OwningEntity));
 }