Open Itangalo opened 2 years ago
I am not 100 percent sure this is a good idea to add to markets. Selling something to the market is in many aspects the same as buying something, which there are already methods for. (Getting gold when selling sugar is the same as buying gold and paying with sugar.)
Will give it a bit more thought.
Ok, I have given it some more thought. This is related to #34.
Selling sugar and getting gold is the same thing as buying gold and paying with sugar, but you could also pay with other sellable items.
Also, you could argue that not all sellable goods should be classified as resources. It thus makes sense to have sell methods.
Will give it even more thought, but mostly on how to implement selling methods.
Data like 'sellable' and resource names suffixed with 'Sell'. And goods.sell(agent), updating the agent's resources.
Agents should not, I think, have agent.goods.whatev, but agent.goodsId. Thins makes for easier creation from spreadsheet, just as with resources.