Moved definition of what robots have which stats into the player interface
This commit is contained in:
@@ -52,7 +52,7 @@ type decoder interface {
|
||||
}
|
||||
|
||||
// Negotiate runs through the hackerbots negociation protocol.
|
||||
func (c *Client) Negotiate(clientType string) (err error) {
|
||||
func (c *Client) Negotiate(clientType string, player Player) (err error) {
|
||||
c.ws, err = connect(c.Server, c.Port)
|
||||
if err != nil {
|
||||
return errors.New(fmt.Sprintf("connection failure: %s", err))
|
||||
@@ -114,10 +114,8 @@ func (c *Client) Negotiate(clientType string) (err error) {
|
||||
switch clientType {
|
||||
case "robot":
|
||||
conf := server.ClientConfig{
|
||||
ID: c.GameId,
|
||||
Stats: map[string]server.StatsRequest{
|
||||
c.Name: c.StatsReq,
|
||||
},
|
||||
ID: c.GameId,
|
||||
Stats: player.GetStats(),
|
||||
}
|
||||
|
||||
err = websocket.JSON.Send(c.ws, conf)
|
||||
|
||||
Reference in New Issue
Block a user