Better multiple
This commit is contained in:
parent
3f19d14fe2
commit
f2cf92644b
|
@ -0,0 +1,19 @@
|
|||
Cylon = require '..'
|
||||
|
||||
bots = [
|
||||
{ name: 'Huey' },
|
||||
{ name: 'Dewey' },
|
||||
{ name: 'Louie' }
|
||||
]
|
||||
|
||||
class ChattyRobot
|
||||
work: (me) ->
|
||||
every 1.seconds(), ->
|
||||
Logger.info me.name
|
||||
|
||||
for bot in bots
|
||||
robot = new ChattyRobot
|
||||
robot.name = bot.name
|
||||
Cylon.robot robot
|
||||
|
||||
Cylon.start()
|
Loading…
Reference in New Issue