Print statements in Battle class

Issue #5 resolved
OceanFlex created an issue

The Battle class contains a lot of print statements. I'm assuming they are all legacy from the old "you must compile it" program and aren't used by the GUI. If that's true, they should be removed unless you are using them while debugging.

I'm working on refractoring the run method of the class right now, and it would be a lot simpler if I didn't have to worry about all the print statements.

Comments (4)

  1. Hottemax repo owner

    You are absolutely correct in your assessment, this is all legacy code from Guandong from the original program. Knock yourself out - I even put some comments in a la "Need to refactor this stuff". You can remove it if you want, I left it in for now for some quick-hack debugging until I get around to using a decent logging framework. My personal focus is first on getting it feature-complete first (i.e. adding all the missing gui elements, fixing the bugs etc), but this needs to be done eventually anyway, so go ahead.

  2. OceanFlex reporter

    There is a comment that says Damage is applied only after all casualties have been computed in the phase. Does this mean the game waits for 3 days before it recalculates regiment strength, or does it mean wait until the regiment took and dealt all casualties in a day before changeing its strength?

    Is there any variable anywhere that represents what army got there first and what army takes terrain penalties? At the moment it looks like BOTH armies take the terrain penalty.

  3. Hottemax repo owner

    That comment is inaccurate (nice that all of you guys read the code in such great detail :D). It is basically buffered until a day is over (not an entire 3-day phase), so that it is not biased towards the side who attacks first (since it then deals less damage in return as it already took damage). This is the best I can recreate it from the wiki.

    Second, no that is not yet done and it is one of the next TODOs (put the relevant modifiers in the GUI TerrainComposite, then apply all the modifiers at the start of the battle). That would also include attacker morale bonus, taking into account defender general maneuver for crossings etc. It will be there in the next few days, good catch.

  4. Log in to comment