Esempio n. 1
0
 // Загрузка данных по указанной технологии
 public void UpdateData(ShipType AShipType, ShipTech ATechType)
 {
     FShipType = AShipType;
     FTechType = ATechType;
     FInfo     = Engine.TechShip(FShipType, FTechType);
     DoUpdateValues();
 }
Esempio n. 2
0
        private void DoReadPlayerTechShipUpdate()
        {
            ShipType LShipType = (ShipType)FReader.ReadInt32();
            ShipTech LTechType = (ShipTech)FReader.ReadInt32();
            // Обновим значение самой категории
            TechInfo LTechInfo = Engine.TechShip(LShipType, LTechType);

            LTechInfo.Level++;
            LTechInfo.Value = LTechInfo.Levels[LTechInfo.Level];
            Engine.TechShip(LShipType, LTechType, LTechInfo);
            // Обновим данные в UI
            Engine.UITechShips.UpdateTech(LShipType, LTechType);
            Engine.UIPlanetDetails.Construct.UpdateData();
        }
Esempio n. 3
0
        private void DoReadPlayerTechBuildingUpdate()
        {
            BuildingType LBuildingType = (BuildingType)FReader.ReadInt32();

            // Пересчитаем все значения технологий для указанного типа строения
            foreach (BuildingTech LBuildingTech in Enum.GetValues(typeof(BuildingTech)))
            {
                if (LBuildingTech == BuildingTech.Empty)
                {
                    continue;
                }
                TechInfo LTechInfo = Engine.TechBuilding(LBuildingType, LBuildingTech);
                LTechInfo.Level++;
                LTechInfo.Value = LTechInfo.Levels[LTechInfo.Level];
                Engine.TechBuilding(LBuildingType, LBuildingTech, LTechInfo);
            }
            // Обновим данные в UI
            Engine.UIPlanetDetails.Buildings.PanelTech.UpdateTech();
        }
Esempio n. 4
0
 private void DoReadPlayerTechBuildingCreate()
 {
     // Перебор всех строений
     foreach (BuildingType LBuildingType in Enum.GetValues(typeof(BuildingType)))
     {
         if (LBuildingType == BuildingType.Empty)
         {
             continue;
         }
         // Перебор всех технологий
         foreach (BuildingTech LTech in Enum.GetValues(typeof(BuildingTech)))
         {
             if (LTech == BuildingTech.Empty)
             {
                 continue;
             }
             TechInfo LTechInfo = new TechInfo();
             LTechInfo.Supported = FReader.ReadBoolean();
             if (LTechInfo.Supported)
             {
                 // Сбор сведений
                 LTechInfo.Name   = LTech.ToString();
                 LTechInfo.Level  = FReader.ReadInt32();
                 LTechInfo.Count  = FReader.ReadInt32();
                 LTechInfo.Levels = new int[6];/*TODO count*/
                 // Перебор уровней технологий
                 for (int LIndex = 0; LIndex <= 5; LIndex++)
                 {
                     LTechInfo.Levels[LIndex] = FReader.ReadInt32();
                 }
                 // Установим текущее значение техи
                 LTechInfo.Value = LTechInfo.Levels[LTechInfo.Level];
             }
             Engine.TechBuilding(LBuildingType, LTech, LTechInfo);
         }
     }
 }
Esempio n. 5
0
 private void DoReadPlayerTechShipCreate()
 {
     // Перебор всех корабликов
     foreach (ShipType LShip in Enum.GetValues(typeof(ShipType)))
     {
         if (LShip == ShipType.Empty)
         {
             continue;
         }
         // Перебор всех технологий
         foreach (ShipTech LTech in Enum.GetValues(typeof(ShipTech)))
         {
             if (LTech == ShipTech.Empty)
             {
                 continue;
             }
             TechInfo LTechInfo = new TechInfo();
             LTechInfo.Supported = FReader.ReadBoolean();
             if (LTechInfo.Supported)
             {
                 // Сбор сведений
                 LTechInfo.Name   = LTech.ToString();
                 LTechInfo.Level  = FReader.ReadInt32();
                 LTechInfo.Count  = FReader.ReadInt32();
                 LTechInfo.Levels = new int[LTechInfo.Count + 1];
                 // Перебор уровней технлогий
                 for (int LIndex = 0; LIndex <= LTechInfo.Count; LIndex++)
                 {
                     LTechInfo.Levels[LIndex] = FReader.ReadInt32();
                 }
                 // Установим текущее значение техи
                 LTechInfo.Value = LTechInfo.Levels[LTechInfo.Level];
             }
             Engine.TechShip(LShip, LTech, LTechInfo);
         }
     }
 }
Esempio n. 6
0
 public static void TechBuilding(BuildingType ABuildingType, BuildingTech ATechType, TechInfo ATech)
 {
     FTechBuildings[(int)ABuildingType, (int)ATechType] = ATech;
 }
Esempio n. 7
0
 public static void TechShip(ShipType AShipType, ShipTech ATechType, TechInfo ATech)
 {
     FTechShips[(int)AShipType, (int)ATechType] = ATech;
 }