labyrinth-game-logic
Version:
A libary that implements the boardgame labyrinth and exposes the functionality to create and interact with games
25 lines (22 loc) • 565 B
text/typescript
import { BoardPosition } from "./BoardPosition";
import { Heading } from "./Heading";
import { Path } from "./Path";
test("length", () => {
const path = new Path([
{
from: new BoardPosition(1, 1),
to: new BoardPosition(1, 2),
heading: Heading.NORTH,
},
]);
expect(path.length).toBe(1);
});
test("getPart", () => {
const part = {
from: new BoardPosition(1, 1),
to: new BoardPosition(1, 2),
heading: Heading.NORTH,
};
const path = new Path([part]);
expect(path.getPart(0)).toBe(part);
});