Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
63
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.  * @param {RoomPosition} pos The center position of the area.
  5.  * @param {number} range The range to search around the position.
  6.  *
  7.  * @return {Array} An array with all the objects in the specified range
  8.  */
  9. Object.defineProperty(Room.prototype, "lookInRange", {
  10.     value: function (pos, range) {
  11.         return this.lookAtArea(pos.y - range, pos.x - range, pos.y + range, pos.x + range, true);
  12.     },
  13.     configurable: true,
  14.     enumerable: false,
  15. });
  16. /**
  17.  * Get the list of objects with the given type at the specified room area.
  18.  *
  19.  * @param {string} type One of the LOOK_* constants.
  20.  * @param {RoomPosition} pos The center position of the area.
  21.  * @param {number} range The range to search around the position.
  22.  *
  23.  * @return {Array} An array with all the objects of the given type in the specified range
  24.  */
  25. Object.defineProperty(Room.prototype, "lookForInRange", {
  26.     value: function (type, pos, range) {
  27.         return this.lookForAtArea(type, pos.y - range, pos.x - range, pos.y + range, pos.x + range, true);
  28.     },
  29.     configurable: true,
  30.     enumerable: false,
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement