exchange beta
Function of @v12-engine/engine
ts
export declare function exchange(world: World, player: PlayerId, sold: string, bought: string, amount: number, rate: number): number;Trades amount of one resource of a player's (sold) for another (bought) at a rate: rate of it for each one sold, rounded down (exchanged), the player told. What the exchange effect does (a marketplace's ability, presetMarket), for a game's own rules. Nothing of a resource the game does not have, of one for itself, or more than the player has. Gives back how much came