UNPKG

@erikyuzwa/rogue-punk

Version:

a JavaScript library to help you build your roguelike adventures

37 lines (36 loc) 914 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.wallTile = exports.floorTile = exports.nullTile = exports.Tile = void 0; const Glyph_1 = require("./Glyph"); class Tile extends Glyph_1.Glyph { constructor(options) { super(options); this.walkable = options.walkable || false; this.diggable = options.diggable || false; this.description = options.description || ''; } isWalkable() { return this.walkable; } isDiggable() { return this.diggable; } toString() { return this.description; } } exports.Tile = Tile; exports.nullTile = new Tile({ description: '(nil)' }); exports.floorTile = new Tile({ character: '.', walkable: true, description: 'floor' }); exports.wallTile = new Tile({ character: '#', fgColor: '#a2a427', diggable: true, description: 'a wall' });