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.
 
 
 

31 rivejä
456 B

  1. //Imports
  2. let factionBase = require('../factionBase');
  3. let factions = require('../factions');
  4. //Internals
  5. const cache = {};
  6. //Method
  7. const getFactionBlueprint = factionId => {
  8. if (cache[factionId])
  9. return cache[factionId];
  10. let res = null;
  11. try {
  12. res = factions.getFaction(factionId);
  13. } catch (e) {}
  14. if (!res)
  15. return;
  16. res = extend({}, factionBase, res);
  17. cache[factionId] = res;
  18. return res;
  19. };
  20. module.exports = {
  21. getFactionBlueprint
  22. };