Get cached planets
@@ -52,6 +52,7 @@ type Wrapper interface {
GetAttacks() []AttackEvent
GalaxyInfos(galaxy, system int) ([]PlanetInfos, error)
GetResearch() Researches
+ GetCachedPlanets() []Planet
GetPlanets() []Planet
GetPlanetByCoord(Coordinate) (Planet, error)
GetPlanet(PlanetID) (Planet, error)
@@ -2762,6 +2763,13 @@ func (b *OGame) GetPlanets() []Planet {
return b.getPlanets()
}
+// GetCachedPlanets return planets from cached value
+func (b *OGame) GetCachedPlanets() []Planet {
+ b.Lock()
+ defer b.Unlock()
+ return b.Planets
+}
+
// GetPlanet gets infos for planetID
// Fails if planetID is invalid
func (b *OGame) GetPlanet(planetID PlanetID) (Planet, error) {
