rem: function initPilesOfType(type, property) { type = id + type; var ps = []; for(var i = 0; true; i++) { var node = initPileFromId(type+i); if(!node) break; node[property] = true; ps.push(node); allpiles.push(node); 
add: const items2 = ["reserve", "cell", "foundation", "pile"]; const props2 = ["isReserve", "isCell", "isFoundation", "isNormalPile"]; const takes2 = ["mayTakeCardFromReserve", "mayTakeCardFromCell", "mayTakeCardFromFoundation", "mayTakeCardFromPile"]; const adds2 = ["mayAddCardToReserve", "mayAddCardToCell", "mayAddCardToFoundation", "mayAddCardToPile"];   for(i = 0; i != 4; i++) { item = items2[i]; var type = id+item+"-", property = props2[i]; var mayTakeCard = this[takes2[i]], mayAddCard = this[adds2[i]]; var ps = this[item+"s"] = []; for(var j = 0; true; j++) { p = initPileFromId(type+j, property, mayTakeCard, mayAddCard); if(!p) break; ps.push(p); allpiles.push(p); 
context:   initPiles: function() {    // Unless these are set explicitly then all games share the same arrays (breaking everything)    var allpiles = this.allpiles = [];    var id = this.id;    function initPileOfType(type, property) {      var pile = initPileFromId(id+type);      if(!pile) return null;      pile[property] = true;      allpiles.push(pile);      return pile;    }    function initPilesOfType(type, property) {      type = id + type;      var ps = [];      for(var i = 0; true; i++) {        var node = initPileFromId(type+i);        if(!node) break;        node[property] = true;        ps.push(node);        allpiles.push(node);      }      if(!i) return ps;      var max = i - 1;      for(i = 0; i != max; i++) ps[i].next = ps[i+1], ps[i+1].prev = ps[i];      return ps;    }    this.stock = initPileOfType("-stock", "isStock");    this.waste = initPileOfType("-waste", "isWaste");    this.foundation = initPileOfType("-foundation", "isFoundation");    this.reserve = initPileOfType("-reserve", "isReserve");    this.piles = initPilesOfType("-pile-", "isNormalPile");    this.foundations = initPilesOfType("-foundation-", "isFoundation");    this.reserves = initPilesOfType("-reserve-", "isReserve");    this.cells = initPilesOfType("-cell-", "isCell");    if(this.stock) {      // a <label/> for displaying the num. of deals left      var counter = this.stock.counter = document.getElementById(id+"-stock-counter");      if(counter) {        counter.set = function(val) { this.value = this._value = val; };        counter.add = function(val) { this.value = this._value += val; };      }    }    // drag'n'drop targets.  could also include cells, but FreeCell/Towers don't use d'n'd in any case    // xxx kill this    this.dragDropTargets = this.cells.concat(this.foundations, this.piles);    if(this.foundation) this.dragDropTargets.push(this.foundation);  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/05e21043701a5724e2c4368f9cf23b22050e0bda/cardgame.js/clean/cardgame.js