Previous space combat play order implementation had potential to overflow stack. Each request to AI play a unit and response to combat controller would happen on the same thread adding function calls to the stack with each exchange. Stack would be reduced to "normal" level only when human player would get his turn (or when combat would end) by accidental nature of GUI implementation.
With message queue which manages play from separate thread such issue would be averted and it opens up a room for better flow control (only one player can play at the time) and validity check (did correct player play the proper unit at proper time).
Previous space combat play order implementation had potential to overflow stack. Each request to AI play a unit and response to combat controller would happen on the same thread adding function calls to the stack with each exchange. Stack would be reduced to "normal" level only when human player would get his turn (or when combat would end) by accidental nature of GUI implementation.
With message queue which manages play from separate thread such issue would be averted and it opens up a room for better flow control (only one player can play at the time) and validity check (did correct player play the proper unit at proper time).