Providing the bot ID to name mapping to the player after negotiation
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user