First pass of multibot support

This commit is contained in:
Fraser Graham
2013-11-08 21:25:42 -08:00
parent 49ff6af1f3
commit e39a97089e
6 changed files with 350 additions and 278 deletions
+4 -11
View File
@@ -149,17 +149,6 @@ func DeriveStats(request StatsRequest) Stats {
return s
}
func (s StatsRequest) Valid() bool {
total := (s.Speed + s.Hp + s.WeaponRadius +
s.ScannerRadius + s.Acceleration + s.TurnSpeed + s.FireRate)
// allowing for 50 pts in every category
if total > 500 {
return false
}
return true
}
type Instruction struct {
Message *string `json:"message,omitempty"`
MoveTo *v.Point2d `json:"move_to,omitempty"`
@@ -170,3 +159,7 @@ type Instruction struct {
Scan *bool `json:"scan,omitempty"`
Stats Stats `json:"stats"`
}
type PlayerInstructions struct {
RobotInstructions map[string]Instruction `json:"instructions"`
}