import { Interpolation, Theme } from '@emotion/react'; import { Location, MaterialMove, MoveItem, MoveItemsAtOnce, XYCoordinates } from '@gamepark/rules-api'; import { ComponentType, ElementType } from 'react'; import { LocationContext, MaterialContext } from '../../../locators'; import { ComponentDescription, ComponentSize } from '../ComponentDescription'; export declare class LocationDescription
extends ComponentDescription , _context: MaterialContext ): ComponentSize;
/**
* Where the area of the location stands on its parent item, in percentage of the parent's size, when that
* differs from where the locator puts the items the location holds. Use {@link getPositionOnParent} to
* provide a dynamic position.
*
* {@link Locator.getPositionOnParent} answers a different question: it says where one *item* of the location
* stands, which is a point - the centre of a pawn, of a card. An area is a box, and the two coincide only
* while the box is the size of what it holds. A drop area drawn the size of the whole parent item is the
* plainest counter-example: it covers the parent, so it is centred on it ({x: 50, y: 50}), whatever spot of
* that parent the items themselves are placed on.
*
* Undefined, the default, means the two do coincide and the locator has the answer.
*/
positionOnParent?: XYCoordinates;
/**
* See {@link positionOnParent}.
*
* @param _location The location
* @param _context Context of the game
* @returns the position of the area on its parent item, or undefined to follow the locator
*/
getPositionOnParent(_location: Location , _context: MaterialContext ): XYCoordinates | undefined;
image?: string;
images?: Record , _context: MaterialContext ): string | undefined;
helpImage?: string;
getHelpImage(location: Location , context: MaterialContext ): string | undefined;
getImages(): string[];
extraCss?: Interpolation , _context: LocationContext ): Interpolation , context: LocationContext ): string[];
highlight?(location: Location , context: MaterialContext ): boolean | undefined;
content?: ComponentType<{
location: Location;
}>;
canLongClick(move: MaterialMove , location: Location , context: MaterialContext ): boolean;
placeOnShortClick: boolean;
canShortClick(move: MaterialMove , location: Location , context: MaterialContext ): boolean;
isMoveToLocation(move: MaterialMove , location: Location , context: MaterialContext ): boolean;
getMoveLocation(move: MoveItem | MoveItemsAtOnce , context: MaterialContext ): Location ;
getShortClickMove(_location: Location , _context: MaterialContext ): MaterialMove | undefined;
getShortClickLocalMove(_location: Location , _context: MaterialContext ): MaterialMove | undefined;
displayInParentItemHelp?: boolean;
/**
* The move to execute in order to display the help dialog about this location.
* By default, open the help about this specific location, but can be overloaded for any other behavior.
* @param location The location
* @param _context Context of the game
* @return The move to play to open the help dialog, if any
*/
displayHelp(location: Location , _context: MaterialContext ): MaterialMove | undefined;
}
export type LocationHelpProps = {
location: Location ;
closeDialog: () => void;
};