removed StatsReq from client struct

This commit is contained in:
Stephen McQuay 2016-07-13 20:12:46 -06:00
parent c21e0c5582
commit 6c67d83f49
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D
2 changed files with 13 additions and 14 deletions

View File

@ -25,7 +25,6 @@ type Client struct {
GameId string GameId string
Name string Name string
Server string Server string
StatsReq server.StatsRequest
Game server.GameParam Game server.GameParam
boardstate *server.Boardstate boardstate *server.Boardstate

View File

@ -43,7 +43,11 @@ func main() {
Name: *botname, Name: *botname,
GameId: gameId, GameId: gameId,
// XXX: update with missing fields // XXX: update with missing fields
StatsReq: server.StatsRequest{ ForceJSON: *forceJSON,
StateStream: make(chan *server.Boardstate),
Die: make(chan struct{}),
}
sr := server.StatsRequest{
Hp: *hp, Hp: *hp,
Speed: *speed, Speed: *speed,
Acceleration: *acceleration, Acceleration: *acceleration,
@ -53,17 +57,13 @@ func main() {
WeaponRadius: *weaponRadius, WeaponRadius: *weaponRadius,
WeaponDamage: *weaponDamage, WeaponDamage: *weaponDamage,
WeaponSpeed: *weaponSpeed, WeaponSpeed: *weaponSpeed,
},
ForceJSON: *forceJSON,
StateStream: make(chan *server.Boardstate),
Die: make(chan struct{}),
} }
switch *botType { switch *botType {
case "simple": case "simple":
c.Player = client.NewSimplePlayer(800, 600, c.StatsReq) c.Player = client.NewSimplePlayer(800, 600, sr)
case "fraserbot": case "fraserbot":
c.Player = client.NewFraserbot("Fraserbot", c.StatsReq) c.Player = client.NewFraserbot("Fraserbot", sr)
} }
var err error var err error