remove game from player struct

This commit is contained in:
sm
2013-09-04 00:08:43 -07:00
parent 64477f5e47
commit 3e805d3da7
3 changed files with 10 additions and 7 deletions
+3 -1
View File
@@ -55,6 +55,7 @@ func (g *game) run() {
for {
select {
case <-g.kill:
log.Printf("%s: received kill signal, dying gracefully", g.id)
return
case p := <-g.register:
g.players[p] = true
@@ -77,6 +78,7 @@ func (g *game) run() {
log.Printf("Explosions: %v", len(g.splosions))
}
// TODO: making one of these every iteration seems wasteful
payload := bot.NewBoardstate(g.turn)
robots_remaining := 0
@@ -84,7 +86,7 @@ func (g *game) run() {
for p := range g.players {
if p.Robot.Health > 0 {
robots_remaining++
p.scan()
p.scan(g.players)
p.nudge()
// XXX: change to pointer, check for pointer as (0, 0) is valid target
if p.Robot.FireAt != nil {