Providing the bot ID to name mapping to the player after negotiation

This commit is contained in:
Fraser Graham
2016-07-13 21:28:57 -06:00
parent 6c67d83f49
commit 9be5f226f5
5 changed files with 81 additions and 25 deletions
+9
View File
@@ -13,6 +13,13 @@ type Player interface {
// containing the desired stats for that robot
GetStats() map[string]server.StatsRequest
// SetIDs is called from the client once the server
// has accepted the robots supplied in GetStats and validated
// their config, the data passed into SetIDs is a mapping of
// bot name to server side bot ID that is used in all bot
// dats sent from the server
SetIDs(map[string]string)
// 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
@@ -20,6 +27,8 @@ type Player interface {
type Spectator struct{}
func (s Spectator) SetIDs(map[string]string) {}
func (s Spectator) GetStats() map[string]server.StatsRequest {
return nil
}