Exemple #1
0
 private void AddBuildings()
 {
     foreach (KeyValuePair <string, BuildingProgress> kvp in BuildingProgress)
     {
         BuildingData buildingData            = GenericDataLoader.GetData <BuildingData>(kvp.Value.ID);
         UnitProgress unitProgressForBuilding = UnitProgress[buildingData.Unit];
         Buildings.Add(new Building(kvp.Value, unitProgressForBuilding));
     }
 }
        public UnitModifier(ProgressBase i_progress)
        {
            mModel = new ViewModel();
            mData  = GenericDataLoader.GetData <T>(i_progress.ID);

            mLevel = new Upgradeable();
            mLevel.SetPropertyToUpgrade(mModel, mData.Level);
            Level.Value = i_progress.Level;
        }
Exemple #3
0
        public Building(BuildingProgress i_buildingProgress, UnitProgress i_unitProgress)
        {
            mModel           = new ViewModel();
            mData            = GenericDataLoader.GetData <BuildingData>(i_buildingProgress.ID);
            Name             = mData.GetName();
            NumUnits         = (int)Math.Floor(i_unitProgress.Count);
            NextUnitProgress = i_unitProgress.Count - NumUnits;

            mLevel = new Upgradeable();
            mLevel.SetPropertyToUpgrade(mModel, mData.BuildingLevel);
            mLevel.UpgradeCompleteEvent += OnUpgraded;
            Level.Value = i_buildingProgress.Level;

            UnitData unitData = GenericDataLoader.GetData <UnitData>(i_unitProgress.ID);

            Unit = new Unit(unitData, i_unitProgress, mModel);

            UpdateViewProperties();

            SubscribeToMessages();
        }