Source: Lights/LightSet.js

  1. /* File: LightSet.js
  2. *
  3. * Support for working with a set of Lights
  4. */
  5. /*jslint node: true, vars: true */
  6. /*global */
  7. /* find out more about jslint: http://www.jslint.com/help.html */
  8. "use strict"; // Operate in Strict mode such that variables must be declared before used!
  9. /**
  10. * Support for working with a set of Lights
  11. * @returns {LightSet} New instance of LightSet
  12. * @class LightSet
  13. */
  14. function LightSet() {
  15. this.mSet = [];
  16. }
  17. /**
  18. * Return the count of lights in set
  19. * @returns {Number} number of lights in set
  20. * @memberOf LightSet
  21. */
  22. LightSet.prototype.numLights = function () { return this.mSet.length; };
  23. /**
  24. * Return the light at index
  25. * @param {Number} index of light to return
  26. * @returns {Light} Light at index
  27. * @memberOf LightSet
  28. */
  29. LightSet.prototype.getLightAt = function (index) {
  30. return this.mSet[index];
  31. };
  32. /**
  33. * Add a light to the current set
  34. * @param {Light} light to add to set
  35. * @returns {void}
  36. * @memberOf LightSet
  37. */
  38. LightSet.prototype.addToSet = function (light) {
  39. this.mSet.push(light);
  40. };