Add ResourcesBuildings & Facilities & Researches to EspionageReport
@@ -93,6 +93,69 @@ func i64(v *int64) int64 {
return *v
}
+// ResourcesBuildings returns a ResourcesBuildings struct from the espionage report
+func (r EspionageReport) ResourcesBuildings() *ResourcesBuildings {
+ if !r.HasBuildings {
+ return nil
+ }
+ return &ResourcesBuildings{
+ MetalMine: i64(r.MetalMine),
+ CrystalMine: i64(r.CrystalMine),
+ DeuteriumSynthesizer: i64(r.DeuteriumSynthesizer),
+ SolarPlant: i64(r.SolarPlant),
+ FusionReactor: i64(r.FusionReactor),
+ SolarSatellite: i64(r.SolarSatellite),
+ MetalStorage: i64(r.MetalStorage),
+ CrystalStorage: i64(r.CrystalStorage),
+ DeuteriumTank: i64(r.DeuteriumTank),
+ }
+}
+
+// Facilities returns a Facilities struct from the espionage report
+func (r EspionageReport) Facilities() *Facilities {
+ if !r.HasBuildings {
+ return nil
+ }
+ return &Facilities{
+ RoboticsFactory: i64(r.RoboticsFactory),
+ Shipyard: i64(r.Shipyard),
+ ResearchLab: i64(r.ResearchLab),
+ AllianceDepot: i64(r.AllianceDepot),
+ MissileSilo: i64(r.MissileSilo),
+ NaniteFactory: i64(r.NaniteFactory),
+ Terraformer: i64(r.Terraformer),
+ SpaceDock: i64(r.SpaceDock),
+ LunarBase: i64(r.LunarBase),
+ SensorPhalanx: i64(r.SensorPhalanx),
+ JumpGate: i64(r.JumpGate),
+ }
+}
+
+// Researches returns a Researches struct from the espionage report
+func (r EspionageReport) Researches() *Researches {
+ if !r.HasResearches {
+ return nil
+ }
+ return &Researches{
+ EnergyTechnology: i64(r.EnergyTechnology),
+ LaserTechnology: i64(r.LaserTechnology),
+ IonTechnology: i64(r.IonTechnology),
+ HyperspaceTechnology: i64(r.HyperspaceTechnology),
+ PlasmaTechnology: i64(r.PlasmaTechnology),
+ CombustionDrive: i64(r.CombustionDrive),
+ ImpulseDrive: i64(r.ImpulseDrive),
+ HyperspaceDrive: i64(r.HyperspaceDrive),
+ EspionageTechnology: i64(r.EspionageTechnology),
+ ComputerTechnology: i64(r.ComputerTechnology),
+ Astrophysics: i64(r.Astrophysics),
+ IntergalacticResearchNetwork: i64(r.IntergalacticResearchNetwork),
+ GravitonTechnology: i64(r.GravitonTechnology),
+ WeaponsTechnology: i64(r.WeaponsTechnology),
+ ShieldingTechnology: i64(r.ShieldingTechnology),
+ ArmourTechnology: i64(r.ArmourTechnology),
+ }
+}
+
// ShipsInfos returns a ShipsInfos struct from the espionage report
func (r EspionageReport) ShipsInfos() *ShipsInfos {
if !r.HasFleet {
