Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Get the list of objects at the specified room area.
  3.  *
  4.  * @type {function}
  5.  *
  6.  * @param {RoomPosition} pos The center position of the area.
  7.  * @param {number} range The range to search around the position.
  8.  *
  9.  * @return {Array} An array with all the objects in the specified range
  10.  */
  11. Object.defineProperty(Room.prototype, "lookInRange", {
  12.     value: function (pos, range) {
  13.         return this.lookAtArea(pos.y - range, pos.x - range, pos.y + range, pos.x + range, true);
  14.     },
  15.     configurable: true,
  16.     enumerable: false,
  17. });
  18. /**
  19.  * Get the list of objects with the given type at the specified room area.
  20.  *
  21.  * @type {function}
  22.  *
  23.  * @param {string} type One of the LOOK_* constants.
  24.  * @param {RoomPosition} pos The center position of the area.
  25.  * @param {number} range The range to search around the position.
  26.  *
  27.  * @return {Array} An array with all the objects of the given type in the specified range
  28.  */
  29. Object.defineProperty(Room.prototype, "lookForInRange", {
  30.     value: function (type, pos, range) {
  31.         return this.lookForAtArea(type, pos.y - range, pos.x - range, pos.y + range, pos.x + range, true);
  32.     },
  33.     configurable: true,
  34.     enumerable: false,
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement