Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Worker
- # Called by jobmanager
- def assign_task(id, action, target, location)
- @task_id = id
- ...
- # Call the worker's movement/action code
- # To join these, we can specify a block to be executed after the movement
- # is completed, which in this case would be the action code or nil if it's
- # just a movement
- end
- # Called internally by the worker
- def done_with_job
- # Call into jobmanager, telling it you're done with @task_id
- @task_id = nil
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement