예제 #1
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);
        }
예제 #2
0
 public void Refresh(bool partialRefresh = false)
 {
     PlanetMineralDepositVM.Refresh();
     RefineryAbilityVM.Refresh();
     ConstructionAbilityVM.Refresh();
     UpdatePop();
     CargoStoreVM.Update();
     foreach (var facilityvm in Facilities)
     {
         facilityvm.Refresh();
     }
 }