float32 -> float64
This commit is contained in:
@@ -15,14 +15,15 @@ import (
|
||||
// ways (json POSTed to server, config file, constants) and are typically owned
|
||||
// by a Controller.
|
||||
type Config struct {
|
||||
Tick int `json:"tick"` // ms
|
||||
Timescale float32 `json:"timescale"`
|
||||
Delta float32 `json:"delta"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
ObstacleCount int `json:"obstacle_count"`
|
||||
MaxPoints int `json:"max_points"`
|
||||
Mode string `json:"mode"`
|
||||
Tick int `json:"tick"` // ms
|
||||
Timescale float64 `json:"timescale"`
|
||||
Delta float64 `json:"delta"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
ObstacleCount int `json:"obstacle_count"`
|
||||
Obstacles []Obstacle `json:'obstacles'`
|
||||
MaxPoints int `json:"max_points"`
|
||||
Mode string `json:"mode"`
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -69,7 +70,7 @@ func LoadConfig(filename string) (Config, error) {
|
||||
return c, errors.New(fmt.Sprintf("config parse error: %s", err))
|
||||
}
|
||||
}
|
||||
c.Delta = (float32(c.Tick) / 1000.0) * float32(c.Timescale)
|
||||
log.Printf("final config: %+v", c)
|
||||
c.Delta = float64(c.Tick) / 1000.0 * c.Timescale
|
||||
log.Printf("final config: %#v", c)
|
||||
return c, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user