@2d-game-grid/square
Version:
A simple square grid made for games
20 lines (19 loc) • 844 B
TypeScript
import { type Coordinate, type Direction, type NeighborCoordinate, Neighbors } from '@2d-game-grid/core';
import type { SquareCell } from './SquareCell.js';
import type { SquareDirections } from './SquareDirections.js';
/**
* The representation of all neighbors of a cell
*/
export declare class SquareNeighbors<Value> extends Neighbors<Value, SquareDirections, SquareCell<Value>> {
/**
* @param directions The allowed directions
* @returns An array of all existing neighbor cell coordinates
*/
listCoordinates(directions?: Direction[]): NeighborCoordinate<Direction>[];
/**
* @param directions The allowed directions
* @returns An array of all existing neighbor cells
*/
list(directions?: Direction[]): SquareCell<Value>[];
protected getOffsetCoordinate(direction: Direction): Coordinate;
}