import { Animation } from '@gamepark/react-client'; import { CreateItem, CreateItemsAtOnce } from '@gamepark/rules-api'; import { ItemContext } from '../../../locators'; import { CreateItemAnimations } from './CreateItemAnimations'; import { MaterialGameAnimationContext } from './MaterialGameAnimations'; import { Trajectory } from './Trajectory'; /** * How long items created together fly for, unless the game says otherwise: not at all. * * {@link CreateItemsAtOnce} is the move a game reaches for to create many items in one small payload — * a whole setup, a deck, a supply — and watching a hundred of them fly in one by one is neither wanted * nor affordable. So the animation exists but is silent until it is asked for, and a game that wants * it says so on the moves it wants it on (see {@link CreateItemsAtOnceAnimations}). */ export declare const defaultCreateAtOnceDuration = 0; /** * The items of a {@link CreateItemsAtOnce} move flying in from the stock, exactly as a single creation * does — several at a time, all leaving together. * * Everything a single creation does is inherited, {@link CreateItemAnimations.getItemAnimation} included: * only *which* items are the new ones is answered differently. They are read off the game rather than * predicted — the quantities of the type are snapshotted before the move and compared after it — so an * item that merged into an existing stack animates as surely as one that took an index of its own, * whatever the location strategies did with them in between. * * Silent unless the game asks, {@link defaultCreateAtOnceDuration} being 0, and silent all the way down: * nothing is snapshotted and nothing is compared while the duration is 0, so the bulk creations this * move exists for cost exactly what they used to. * * @example * ```ts * animations.configure(and(isMaterial(MaterialType.Pawn), isMoveType(ItemMoveType.CreateAtOnce))).duration(1000) * ``` * * The three methods below take a creation of either shape, though only the batch one ever reaches them: * a class may not narrow what it inherits to an unrelated type, and a creation of one item and a creation * of several are exactly that — one carries an `item`, the other a list of `items`. Neither method reads * either field: what they need, `itemType`, both shapes carry. */ export declare class CreateItemsAtOnceAnimations
extends CreateItemAnimations
{ constructor(duration?: number, trajectory?: Trajectory
); getPreDuration(move: CreateItem
| CreateItemsAtOnce
, context: MaterialGameAnimationContext
): number; getPostDuration(move: CreateItem
| CreateItemsAtOnce
, context: MaterialGameAnimationContext
): number; isItemToAnimate(context: ItemContext
, animation: Animation >): boolean;
}