import { Coordinates, Location, MaterialItem, MoveItem, Polyomino, XYCoordinates } from '@gamepark/rules-api'; import { LocationDescription } from '../components'; import { ItemContext, Locator, MaterialContext } from './Locator'; /** * This locator is responsible for placing locations and items on a square grid (for Polyominoes). */ export declare abstract class SquareGridLocator
extends Locator
{
/**
* The size of one square cell (width and height, in em). For non-square cells, the size can use XY values.
*/
abstract size: number | XYCoordinates;
/**
* Horizontal size of a cell
*/
protected get sizeX(): number;
/**
* Vertical size of a cell
*/
protected get sizeY(): number;
/**
* Polyomino of the drop area
*/
dropArea?: Polyomino , _context: MaterialContext ): Polyomino , context: MaterialContext ): Partial , context: MaterialContext ): Partial , context: ItemContext ): Partial , _context: MaterialContext ): number;
/**
* Returns the drop locations for current dragged item. The square grid must be one simple drop location.
*/
getDropLocations(moves: MoveItem [], context: ItemContext ): Location [];
dropPreview: boolean;
/**
* Generate automatically a {@link SquareGridDropAreaDescription} based on the grid boundaries
*/
getLocationDescription(location: Location , context: MaterialContext | ItemContext ): LocationDescription | undefined;
/**
* Compute the boundaries of a polyomino, in em (relative to the grid origin). Empty cells on the edges are ignored.
* @param polyomino The polyomino to measure
* @return the boundaries in em
*/
getBoundaries(polyomino: Polyomino