Add GetRange to phalanx obj
package ogame
+import "math"
+
type sensorPhalanx struct {
BaseBuilding
}
@@ -13,3 +15,16 @@ func newSensorPhalanx() *sensorPhalanx {
b.Requirements = map[ID]int{LunarBaseID: 1}
return b
}
+
+// GetRange gets sensor range
+func (p sensorPhalanx) GetRange(lvl int) int {
+ phalanxRange := 0
+ if lvl == 0 {
+ phalanxRange = 0
+ } else if lvl == 1 {
+ phalanxRange = 1
+ } else {
+ phalanxRange = int(math.Pow(float64(lvl), 2)) - 1
+ }
+ return phalanxRange
+}
