client/player.go

30 lines
910 B
Go

package client
import "hackerbots.us/server"
// Player is the interface that is implemented when specifying non-default
// player behavior.
//
// The general case will be to implement a Player type that contains the magic
// required to slay other robots quickly while staying alive for a long time.
type Player interface {
// GetStats returns a map with an entry for each robot the player will control
// containing the desired stats for that robot
GetStats() map[string]server.StatsRequest
// Update is called on reciept of a board state packet and the response is
// the instructions for each robot in a map of robot id to instructions
Update(bs *server.Boardstate) map[string]server.Instruction
}
type Spectator struct{}
func (s Spectator) GetStats() map[string]server.StatsRequest {
return nil
}
func (s Spectator) Update(bs *server.Boardstate) map[string]server.Instruction {
return nil
}