// Загрузка данных по указанной технологии public void UpdateData(ShipType AShipType, ShipTech ATechType) { FShipType = AShipType; FTechType = ATechType; FInfo = Engine.TechShip(FShipType, FTechType); DoUpdateValues(); }
// Проверка кнопки на принадлежность к обновляемой технологии public bool CheckUpdate(ShipType AShipType, ShipTech ATechType) { bool LCheck = ((FShipType == AShipType) && (FTechType == ATechType)); if (LCheck) { UpdateData(AShipType, ATechType); } return(LCheck); }
// Обновление уровня технологии public void UpdateTech(ShipType AShipType, ShipTech ATechID) { // Обновление кнопки технологии foreach (MonoUIObjectTechShipBuy FButton in FButtons) { if (FButton.CheckUpdate((ShipType)AShipType, (ShipTech)ATechID)) { return; } } }
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(); }
public static void TechShip(ShipType AShipType, ShipTech ATechType, TechInfo ATech) { FTechShips[(int)AShipType, (int)ATechType] = ATech; }
public static TechInfo TechShip(ShipType AShipType, ShipTech ATechType) { return(FTechShips[(int)AShipType, (int)ATechType]); }
// Возвращение технологии по типу public TechInfo Tech(ShipTech ATechType) { return(Engine.TechShip(ShipType, ATechType)); }