Advertisement
Guest User

Untitled

a guest
Jan 6th, 2017
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Object.defineProperty(OwnedStructure.prototype, "memory", {
  2.     get: function () {
  3.         if (!Memory.structures) {
  4.             Memory.structures = {};
  5.         }
  6.         if (!Memory.structures[this.id]) {
  7.             Memory.structures[this.id] = {};
  8.         }
  9.         return Memory.structures[this.id];
  10.     },
  11.     set: function(v) {
  12.         return _.set(Memory, `structures.${this.id}`, v);
  13.     },
  14.     configurable: true,
  15.     enumerable: false,
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement