Skip to content

Migration to v53 (lifeform bonuses)

Alain Gilbert edited this page Jun 5, 2024 · 3 revisions

Changes to the interfaces:

wrapper.Prioritizable

+   GetLfBonuses() (ogame.LfBonuses, error)
+   GetCachedLfBonuses() (ogame.LfBonuses, error)

-   UseDM(string, ogame.CelestialID) error
+   UseDM(ogame.DMType, ogame.CelestialID) error

ogame.Ship

-   GetCargoCapacity(techs IResearches, bonus LfShipBonus, characterClass CharacterClass, multiplier float64, probeRaids bool) int64
-   GetFuelConsumption(techs IResearches, bonus LfShipBonus, characterClass CharacterClass, fleetDeutSaveFactor float64) int64
-   GetSpeed(techs IResearches, bonus LfShipBonus, characterClass CharacterClass) int64

+   GetCargoCapacity(techs IResearches, bonus LfBonuses, characterClass CharacterClass, multiplier float64, probeRaids bool) int64
+   GetFuelConsumption(techs IResearches, bonus LfBonuses, characterClass CharacterClass, fleetDeutSaveFactor float64) int64
+   GetSpeed(techs IResearches, bonus LfBonuses, characterClass CharacterClass) int64

ogame.BaseOgameObj

-   ConstructionTime(nbr, universeSpeed int64, acc BuildAccelerators, hasTechnocrat, isDiscoverer bool) time.Duration
+   ConstructionTime(nbr, universeSpeed int64, acc BuildAccelerators, lfBonuses LfBonuses, class CharacterClass, hasTechnocrat bool) time.Duration

-   GetPrice(int64) Resources
+   GetPrice(int64, LfBonuses) Resources

ogame.DefenderObj

-   DefenderConstructionTime(nbr, universeSpeed int64, acc DefenseAccelerators) time.Duration
+   DefenderConstructionTime(nbr, universeSpeed int64, acc DefenseAccelerators, lfBonuses LfBonuses) time.Duration

ogame.Technology

-   TechnologyConstructionTime(nbr, universeSpeed int64, acc TechAccelerators, hasTechnocrat, isDiscoverer bool) time.Duration
+   TechnologyConstructionTime(nbr, universeSpeed int64, acc TechAccelerators, lfBonuses LfBonuses, class CharacterClass, hasTechnocrat bool) time.Duration

ogame.Building

-   BuildingConstructionTime(nbr, universeSpeed int64, acc BuildingAccelerators) time.Duration
+   BuildingConstructionTime(nbr, universeSpeed int64, acc BuildingAccelerators, lfBonuses LfBonuses) time.Duration

ogame.ShipsInfos

-func (s ShipsInfos) Speed(techs Researches, isCollector, isGeneral bool) int64 {
+func (s ShipsInfos) Speed(techs IResearches, lfShipBonuses LfShipBonuses, characterClass CharacterClass) int64 {

-func (s ShipsInfos) Cargo(techs Researches, probeRaids, isCollector, isPioneers bool) (out int64) {
+func (s ShipsInfos) Cargo(techs IResearches, bonuses LfShipBonuses, characterClass CharacterClass, multiplier float64, probeRaids bool) (out int64) {

Public functions changes:

 func CalcFlightTime(origin, destination ogame.Coordinate, universeSize, nbSystems int64, donutGalaxy, donutSystem bool,
-   fleetDeutSaveFactor, speed float64, universeSpeedFleet int64, ships ogame.ShipsInfos, techs ogame.Researches, characterClass ogame.CharacterClass) (secs, fuel int64) {
+   fleetDeutSaveFactor, speed float64, universeSpeedFleet int64, ships ogame.ShipsInfos, techs ogame.Researches, lfShipBonuses ogame.LfShipBonuses, characterClass ogame.CharacterClass) (secs, fuel int64) {

While making breaking changes, SendFleet/EnsureFleet now take a ShipsInfos instead of a []ogame.Quantifiable

wrapper.Celestial

-   EnsureFleet([]ogame.Quantifiable, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error)
+   EnsureFleet(ogame.ShipsInfos, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error)

-   SendFleet([]ogame.Quantifiable, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error)
+   SendFleet(ogame.ShipsInfos, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error)

wrapper.Prioritizable

-   EnsureFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
+   EnsureFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

-   SendFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
+   SendFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
Clone this wiki locally