- adding tests for issue 489 and issue 491
- check for null pointers in Credits.cpp
- Test suite can now select tokens by their name
- Fixed Dragon Broodmothere's token name
- fixing buggy test for kicker introduced in r2414
- removed old translation tool scripts (not needed anymore)
- simplified "borderline.txt" using the global "borderline" grade.
Also moved some static value definitions used in the drawing code from the class header to a private namespace in the cpp file, as they don't need to be seen by any clients of the class.
Also renamed WindowRect to windowRect & PixelFormat to pixelFormat for consistency with other locally declared variables. (Uppercase should be reserved for class names, ie WindowRect is the class/struct, windowRect is an local object in your code.)
( ie task list was being updated, set information being evaluated, etc )
put a guard around the endgame stat update process to only update when non-testsuite games are played.
Issue: 488
Some of the things refactored to the base class:
- isPaymentSet()
- canPay()
- Render()
- setSource()
- setPayment()
- the target instance
- duplicated constructor initialization crap
I'm not interested in pointing fingers as to how the code got this way, but I'll ask that everyone who's altered this code in one fashion or another to carefully diff this change and understand what I refactored. This code is a poster child for neglect & what happens when people start blindly copy & pasting code instead of paying attention to the commonality between code paths. If you see the same lines of code happening over & over, and you're about to make yet another copy, please stop yourself & think about how you can refactor the code to be in a single shared function (or, more explicitly, a shared base member function when possible).
If you don't understand what I mean by a shared base member function, then I would suggest at the very least reading up on this topic:
http://www.cplusplus.com/doc/tutorial/inheritance/
(And, after all that, if you're still unsure how to proceed, ping someone else for advice!)
"It's currently unclear for me why several instances of the same hgeparticlesystem with the same .psi file are created..."
The GameApp::Create() call was initializing an array of particles, but it wasn't actually stashing them in the psi cache. The MenuItems also create the particles, but these are stashed correctly in the cache at that point. So, I simply removed the unused particle array loading code since it wasn't actually caching anything correctly & therefore simply adding redundant reading of the same particle files.
http://www.wololo.net/forum/viewtopic.php?f=21&t=1430&start=40#p13465
Seems to work from my testing so far. If this is the preferred route, we should probably sweep through & track down all the other cards that use the token counter hack, as that method used to work in 0.12.1 and broke some time after that.
(Somebody please sanity check this for me, as this is my first foray in messing with card rules.)