You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

59 lines
842 B

  1. let components = [
  2. 'keyboardMover',
  3. 'mouseMover',
  4. 'player',
  5. 'pather',
  6. 'attackAnimation',
  7. 'lightningEffect',
  8. 'moveAnimation',
  9. 'bumpAnimation',
  10. 'animation',
  11. 'light',
  12. 'lightPatch',
  13. 'projectile',
  14. 'particles',
  15. 'explosion',
  16. 'spellbook',
  17. 'inventory',
  18. 'stats',
  19. 'chest',
  20. 'effects',
  21. 'quests',
  22. 'events',
  23. 'resourceNode',
  24. 'gatherer',
  25. 'stash',
  26. 'flash',
  27. 'chatter',
  28. 'dialogue',
  29. 'trade',
  30. 'reputation',
  31. 'serverActions',
  32. 'social',
  33. 'passives',
  34. 'sound'
  35. ].map(function (c) {
  36. return 'js/components/' + c;
  37. });
  38. define(components, function () {
  39. let templates = {};
  40. [].forEach.call(arguments, function (t) {
  41. templates[t.type] = t;
  42. });
  43. return {
  44. getTemplate: function (type) {
  45. if (type === 'lightpatch')
  46. type = 'lightPatch';
  47. let template = templates[type] || {
  48. type: type
  49. };
  50. return template;
  51. }
  52. };
  53. });