Closed santolucito closed 3 years ago
Hi @santolucito, thanks for the contribution. A few recommended changes:
cancel_order
to maintain naming convention.Byte
(Int8ub
is just an alias -- and then there's no need for an extra import -- which is currently missing -- see the failed build).Good points, fixed in most recent commit
Thanks, merged!
the full parser did not support extracting which item is being cancelled when the action is an order to cancel production (building_id = -1). It seems this is a single byte that was being treated as padding. Not sure if this byte has a role when the order is not to cancel production, but since it was treated as padding prior to this pull request, this should not break anything.
Interestingly, the queue is grouped by unit/research type, excepting the current item in production. The current item in production is always 0. The next "group" (e.g. multiple vills) is 1, then the next group would be 2 (even if there are, for example, 10 vill queued ahead of that. As an example, if you have the queue:
villA -> villB-> villC -> loom
cancelling villA will have "cancelOrder" = 0. cancelling villC will have "cancelOrder" = 1. cancelling villB will have "cancelOrder" = 1. cancelling loom will have "cancelOrder" = 2.