So, it seems like the big re-structuring I've been vaguely referring to last post finally came to pass in our generation (i.e., last week), and not without some headache, mind you. The reason for it, was that I put too much responsibility on the 'Client' class on the one hand, and diffused responsibility for communicating with the server on the other.
The first issue was problematic since the class threatened to grow out of proportion, and take over pretty much everything that was going on in the client as a whole (a big no-no in OOP ;) ). The second issue was problematic, since diffusing responsibility for client-server communication meant an uber-headache every time there is an update in protocol... plus it was just un-aesthetic the old way ;) . Now there is a class which handles the logical operation of the client (solution of the first issue!), and also now all client-server communication is handled by the 'Client' class, which makes code much more readable, class-contracts much more focused on the task-at-hand, and will save lots of headache when the protocol will change. Whew :)
There still remain a couple of things that lack support in the so-called 'game-library', which is a client-side library representing the game-world (see previous posts where it's discussed!), namely support for orders and resources, but this is a minor issue, and should be resolved without much fuss early next week. Afterwards, it's Robot Coding Time! Although I have a decent idea of the design, it will need to become concrete Java code. So, the main task for next week, will be to build all necessary infrastructure for the AI bot, and start work on it... finally!
I guess this sums it up nicely. I'll keep you posted!
Victor Ivri (vi1985)
Blog address: BLOG
You can find the project in the git repo here: REPO