Small robot refactor
This commit is contained in:
parent
9e92514efe
commit
6cbeb71d00
10
robot.go
10
robot.go
|
@ -20,9 +20,7 @@ type Robot struct {
|
|||
|
||||
func (r *Robot) Start() {
|
||||
r.initName()
|
||||
for k, _ := range r.Commands {
|
||||
r.RobotCommands = append(r.RobotCommands, k)
|
||||
}
|
||||
r.initCommands()
|
||||
r.initConnections()
|
||||
r.initDevices()
|
||||
r.startConnections()
|
||||
|
@ -39,6 +37,12 @@ func (r *Robot) initName() {
|
|||
}
|
||||
}
|
||||
|
||||
func (r *Robot) initCommands() {
|
||||
for k, _ := range r.Commands {
|
||||
r.RobotCommands = append(r.RobotCommands, k)
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Robot) initConnections() {
|
||||
r.connections = make([]*Connection, len(r.Connections))
|
||||
fmt.Println("Initializing connections...")
|
||||
|
|
Loading…
Reference in New Issue