remove some unused data from payload
This commit is contained in:
parent
6ff9606367
commit
43b68f27f8
6
game.go
6
game.go
@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v "bitbucket.org/hackerbots/vector"
|
|
||||||
// "encoding/json"
|
// "encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
@ -41,9 +40,8 @@ func NewBoardstate() *Boardstate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Scanner struct {
|
type Scanner struct {
|
||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
Position v.Point2d `json:"position"`
|
Type string `json:"type"`
|
||||||
Type string `json:"type"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MapLock struct {
|
type MapLock struct {
|
||||||
|
12
player.go
12
player.go
@ -181,11 +181,7 @@ func (p *player) scan(g *game) {
|
|||||||
dist := v.Distance(player.Robot.Position, p.Robot.Position)
|
dist := v.Distance(player.Robot.Position, p.Robot.Position)
|
||||||
if dist < float32(p.Robot.Stats.ScannerRadius) {
|
if dist < float32(p.Robot.Stats.ScannerRadius) {
|
||||||
s := Scanner{
|
s := Scanner{
|
||||||
Id: player.Robot.Id,
|
Id: player.Robot.Id,
|
||||||
Position: v.Point2d{
|
|
||||||
X: player.Robot.Position.X,
|
|
||||||
Y: player.Robot.Position.Y,
|
|
||||||
},
|
|
||||||
Type: "robot",
|
Type: "robot",
|
||||||
}
|
}
|
||||||
p.Robot.Scanners = append(p.Robot.Scanners, s)
|
p.Robot.Scanners = append(p.Robot.Scanners, s)
|
||||||
@ -200,11 +196,7 @@ func (p *player) scan(g *game) {
|
|||||||
dist := v.Distance(proj.Position, p.Robot.Position)
|
dist := v.Distance(proj.Position, p.Robot.Position)
|
||||||
if dist < float32(p.Robot.Stats.ScannerRadius) {
|
if dist < float32(p.Robot.Stats.ScannerRadius) {
|
||||||
s := Scanner{
|
s := Scanner{
|
||||||
Id: proj.Id,
|
Id: proj.Id,
|
||||||
Position: v.Point2d{
|
|
||||||
X: proj.Position.X,
|
|
||||||
Y: proj.Position.Y,
|
|
||||||
},
|
|
||||||
Type: "projectile",
|
Type: "projectile",
|
||||||
}
|
}
|
||||||
p.Robot.Scanners = append(p.Robot.Scanners, s)
|
p.Robot.Scanners = append(p.Robot.Scanners, s)
|
||||||
|
Loading…
Reference in New Issue
Block a user