Commit Graph

5 Commits (master)

Author SHA1 Message Date
Leandro Doctors 2733516cb9 Organize imports 2020-01-16 08:21:24 +08:00
Bilbo a6e97873fd Optimize mesage generation.
* 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.
2019-12-13 05:25:23 +01:00
Bilbo 22a1471424 Add "card test" mode that tests all cards in a predefined scenario. 2019-12-06 23:04:39 +01:00
Bilbo 28732e250a Implement cost reduction to apply for most cases of reducing hybrid/split/phyrexian cost.
Extend unit test with those cases.
2018-11-04 10:05:25 +08:00
Bilbo a41d91b67b Unit test for increasing and reducing mana cost 2018-11-02 11:55:24 +08:00