Skip to content

Instantly share code, notes, and snippets.

@nakosung
Created September 13, 2013 08:21
Show Gist options
  • Save nakosung/6548022 to your computer and use it in GitHub Desktop.
Save nakosung/6548022 to your computer and use it in GitHub Desktop.
Items!
ship.use require 'cargoship-modules'
ship.register 'library', (a,next) ->
@require 'bank', (err,bank) ->
return next err if err
bank.get_library next
ship.use (m) ->
ship.require 'bank', 'library', (err,bank,library) ->
bank.read CurrentUser.id, (err,docs) ->
docs.forEach (doc) ->
library[doc.type].appearance
ship.require 'exchanges', (err,xchg) ->
xchr.exchange CurrentUser.id, 'consume_stone', (err) ->
xchr.exchange CurrentUser.id, 'buy_stone', (err) ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment