SHARE
TWEET

Untitled

a guest Jul 5th, 2017 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Worker
  2.   # Called by jobmanager
  3.   def assign_task(id, action, target, location)
  4.     @task_id = id
  5.     ...
  6.  
  7.     # Call the worker's movement/action code
  8.     # To join these, we can specify a block to be executed after the movement
  9.     #  is completed, which in this case would be the action code or nil if it's
  10.     #  just a movement
  11.   end
  12.  
  13.   # Called internally by the worker
  14.   def done_with_job
  15.     # Call into jobmanager, telling it you're done with @task_id
  16.  
  17.     @task_id = nil
  18.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top