join_org_class.lua 799 B

12345678910111213141516171819202122232425262728293031323334353637
  1. -- JOIN ORG
  2. -- Module that enables a user to join an org
  3. modpol.modules.join_org = {}
  4. module = modpol.modules.join_org
  5. JoinOrg = {}
  6. JoinOrg_mt = { __index = JoinOrg }
  7. function JoinOrg:create(initiator, org)
  8. local inst = {
  9. name = "Join an org",
  10. desc = "Initiator chooses an org to become a member of. Nothing happens if they are already in an org."
  11. }
  12. setmetatable(inst, JoinOrg_mt)
  13. return inst
  14. end
  15. function JoinOrg:initiate(initiator, org, result)
  16. modpol.interactions.binary_poll_user(initiator, "Would you like to join", )
  17. end
  18. function JoinOrg:request()
  19. end
  20. function JoinOrg:implement()
  21. self.org:add_member(self.initiator)
  22. end
  23. -- ===================================
  24. -- When calling a module internally
  25. test = JoinOrg.create()
  26. test:initiate("luke")