lychees's picture
Upload 569 files
87b3b3a
raw
history blame contribute delete
433 Bytes
/**
* @class Simple empty rectangular room
* @augments ROT.Map
*/
ROT.Map.Arena = function(width, height) {
ROT.Map.call(this, width, height);
}
ROT.Map.Arena.extend(ROT.Map);
ROT.Map.Arena.prototype.create = function(callback) {
var w = this._width-1;
var h = this._height-1;
for (var i=0;i<=w;i++) {
for (var j=0;j<=h;j++) {
var empty = (i && j && i<w && j<h);
callback(i, j, empty ? 0 : 1);
}
}
return this;
}