Trading Game Dev Diary #2

Added buy mechanic with checking for sufficient funding and draining quantity from ask positions. Might need to refactor player struct before I can clone the code for the sell mechanic. This allows AI players to use the same functions. I missed that fact during the creation of the data structure. A common mistake while exploring mechanics and deving prototypes. It is better to sketch the complete data structure first in order to avoid dangerous one-way streets later.

There is no buy button yet, function is triggered just by pressing “B” on the keyboard.

Order book and funding / spot bag before buy.
After buy triggered.