malwoden
Version:
   
29 lines • 1.08 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var rect_1 = require("../struct/rect");
var util_1 = require("./util");
describe("getSimpleHallwayFromRooms", function () {
// A B
// C D
var roomA = new rect_1.Rect({ x: 1, y: 1 }, { x: 1, y: 1 });
var roomB = new rect_1.Rect({ x: 3, y: 1 }, { x: 3, y: 1 });
var roomC = new rect_1.Rect({ x: 1, y: 3 }, { x: 1, y: 3 });
var roomD = new rect_1.Rect({ x: 3, y: 3 }, { x: 3, y: 3 });
it("can create a hallway from basic rooms - horizontal", function () {
expect(util_1.getSimpleHallwayFromRooms(roomA, roomB)).toEqual([
{ x: 1, y: 1 },
{ x: 2, y: 1 },
{ x: 3, y: 1 },
]);
});
it("can create a hallway from rooms - diagonal", function () {
expect(util_1.getSimpleHallwayFromRooms(roomA, roomD)).toEqual([
{ x: 1, y: 1 },
{ x: 1, y: 2 },
{ x: 1, y: 3 },
{ x: 2, y: 3 },
{ x: 3, y: 3 },
]);
});
});
//# sourceMappingURL=util.spec.js.map