private bool IsEquipmentUnlockedByRequirement(EquipmentVO vo, ref BuildingTypeVO req)
 {
     if (vo != null && !string.IsNullOrEmpty(vo.BuildingRequirement))
     {
         BuildingLookupController buildingLookupController = Service.Get <BuildingLookupController>();
         req = buildingLookupController.GetEquipmentUnlockRequirement(vo);
         return(req == null || buildingLookupController.HasConstructedBuilding(req));
     }
     return(true);
 }
Beispiel #2
0
 private bool IsSpecialAttackUnlockedByRequirement(SpecialAttackTypeVO vo, ref BuildingTypeVO req)
 {
     if (vo != null && !string.IsNullOrEmpty(vo.BuildingRequirement))
     {
         BuildingLookupController buildingLookupController = Service.BuildingLookupController;
         req = buildingLookupController.GetStarshipUnlockRequirement(vo);
         return(req == null || buildingLookupController.HasConstructedBuilding(req));
     }
     return(true);
 }
        private bool IsBuildingUnlockedByRequirement(BuildingTypeVO vo, int buildOrUpgrade, ref BuildingTypeVO req)
        {
            bool flag = true;

            if (buildOrUpgrade == 0)
            {
                vo = Service.Get <BuildingUpgradeCatalog>().GetMinLevel(vo);
            }
            BuildingLookupController buildingLookupController = Service.Get <BuildingLookupController>();
            IDataController          dataController           = Service.Get <IDataController>();

            if (!string.IsNullOrEmpty(vo.BuildingRequirement))
            {
                req  = dataController.Get <BuildingTypeVO>(vo.BuildingRequirement);
                flag = buildingLookupController.HasConstructedBuilding(req);
            }
            if (flag && !string.IsNullOrEmpty(vo.BuildingRequirement2))
            {
                req  = dataController.Get <BuildingTypeVO>(vo.BuildingRequirement2);
                flag = buildingLookupController.HasConstructedBuilding(req);
            }
            return(flag);
        }