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.
 
 
 

39 line
571 B

  1. define([
  2. ], function (
  3. ) {
  4. return {
  5. list: [],
  6. register: function (cpn) {
  7. this.list.push(cpn);
  8. },
  9. unregister: function (cpn) {
  10. this.list.spliceWhere(l => l === cpn);
  11. },
  12. render: function () {
  13. let list = this.list;
  14. let lLen = list.length;
  15. for (let i = 0; i < lLen; i++) {
  16. let l = list[i];
  17. if (l.destroyed || !l.obj || l.obj.destroyed) {
  18. if ((l.destroyManual && !l.destroyManual()) || !l.destroyManual) {
  19. list.splice(i, 1);
  20. i--;
  21. lLen--;
  22. continue;
  23. }
  24. }
  25. l.renderManual();
  26. }
  27. }
  28. };
  29. });