///
///
/**
* Maps can hold information of certain rooms or a region.
* If a player has a map, all the rooms in the map are always remembered.
*/
class MapNote extends Thing {
public rooms : Array = [];
public regions : Array = [];
public addRoom (...rooms : Array) {
rooms.forEach((room) => {
this.rooms.push(room);
});
}
public addRegion (...regions : Array) {
regions.forEach(region => {
this.regions.push(region);
});
}
public contains (room : Room) {
if(this.rooms.indexOf(room) != -1) {
return true;
} else {
for (var i = 0; i < this.regions.length; i++) {
if (this.regions[i].getRooms().indexOf(room) != -1) {
return true;
}
}
}
}
}