Open Itangalo opened 2 years ago
Or: Is this better handled by markets belonging to each player? No. Some goods are available to more than one player, but not all.
A crude but working solution would be to have a property 'accessibleFor' for each goods (or alternative price), being an array of agent IDs. If an array is present, only the listed agents can use the price.
An alternative is to have an access callback function, passing the agent as argument. This would be more useful for cases like "only players with at least 4 bases can buy this achievement".
Goods could have something like goods.checkAccess() that restricts who can buy it. Good when some goods (such as actions) are only available for one player.