import { Coordinates, HexGridSystem, Location, MaterialItem, MoveItem, Polyhex, XYCoordinates } from '@gamepark/rules-api'; import { LocationDescription } from '../components'; import { ItemContext, Locator, MaterialContext } from './Locator'; export declare enum HexOrientation { Flat = 1, Pointy = 2 } /** * This locator is responsible for placing locations and items on a hexagonal grid. */ export declare abstract class HexagonalGridLocator

extends Locator { /** * The coordinates system used by the location and items to place */ abstract coordinatesSystem: HexGridSystem; /** * When using Axial coordinates system, you must specify the hexagons orientation */ orientation?: HexOrientation; /** * The size of one hexagon, i.e. the distance between the center of the hexagon and its vertices. * For irregular hexagons, the distance can use XY values. */ abstract size: number | XYCoordinates; /** * Horizontal size of a hexagon */ protected get sizeX(): number; /** * Vertical size of a hexagon */ protected get sizeY(): number; /** * Polyhex of the drop area */ dropArea?: Polyhex; /** * Override if you need a dynamic drop area * @param _location The location to consider * @param _context Context of the game * @return the current drop area */ getDropArea(_location: Location, _context: MaterialContext): Polyhex | undefined; /** * Get the coordinates for the full grid area * @param location Location to place * @param context Context of the game * @returns The coordinates of the area */ getAreaCoordinates(location: Location, context: MaterialContext): Partial; /** * Get the coordinates of a location on the grid * @param location Location to place * @param context Context of the game * @return the coordinates */ getLocationCoordinates(location: Location, context: MaterialContext): Partial; /** * Get the position of a hexagon * @param coordinates Coordinates of the hexagon * @param coordinatesSystem System of coordinates to consider * @return coordinates to place the hexagon on the location */ getHexagonPosition(coordinates: Partial, coordinatesSystem?: HexGridSystem): XYCoordinates; /** * Get the coordinates of an item on the grid. If the item is a Polyhex, the shape will be used to center the origin coordinates of the item on the * correct grid location. * @param item Item to place * @param context Context of the game * @return the coordinates of the item */ getItemCoordinates(item: MaterialItem, context: ItemContext): Partial; /** * Rotate the location. On a hexagonal grid, by default the rotation is expected to be [0, 5] and it is multiplied by 60 degrees. * @param location Location to rotate * @param _context Context of the item * @return the location's rotation in degrees */ getRotateZ(location: Location, _context: MaterialContext): number; /** * Returns the drop locations for current dragged item. The hexagonal grid must be one simple drop location. */ getDropLocations(moves: MoveItem[], context: ItemContext): Location[]; dropPreview: boolean; /** * Generate automatically a {@link HexGridDropAreaDescription} based on the grid boundaries */ getLocationDescription(location: Location, context: MaterialContext | ItemContext): LocationDescription | undefined; getBoundaries(polyhex: Polyhex): { xMin: number; xMax: number; yMin: number; yMax: number; }; }