Esempio n. 1
0
/* Orders an actor to loop the commands indefinately */
func (orders Orders) Loop(actor *core.Actor) {
	commands := make([]func(), 0)
	for _, order := range orders {
		command := order.Create()
		commands = append(commands, command)
	}
	actor.Loop(func() {
		for _, command := range commands {
			command()
		}
	})
}
Esempio n. 2
0
/* Orders an actor to execute the commands */
func (orders Orders) Execute(actor *core.Actor) {
	for _, order := range orders {
		command := order.Create()
		actor.Issue(command)
	}
}