* Use faster stringbuilder for card token formatting instead of full-blown formatter. * When SN/RN/PN and similar placeholders are expanded, calculate the replacement value only if the placeholder is present in the string. In a test with some random games: 55.4M times replaceName was called 39.2M times SN was present 2.0M times PN was present 0.2M times RN was present 0.2M times X was present * Generate event description on demand, instead on event construction. In a test with some random games: 71.601M times description is generated 0.258M time it is actually read or used By postponing generating the description to a point when it is actually needed, CPU time spent when going through possible actions is reduced to about 80%, so in given amount of time, MMAB AI and similar is able to examine larger part of the possible game states. |
||
---|---|---|
.. | ||
MagicManaCostTest.java | ||
MagicMessageTest.java |