Commit Graph

58 Commits (master)

Author SHA1 Message Date
Leandro Doctors 2733516cb9 Organize imports 2020-01-16 08:21:24 +08:00
Martin Petricek bd5ae5fd7a Refactoring (#1543)
* Fix typos.

* Remove unnecessary boxing/unboxing.

* Replace traditional 'for' loops with 'foreach' loops.

* Replace explicit types with <> (diamonds) where they can be inferred.

* Collapse identical catch branches.

* Replace statement lambda with expression lambda for short statements.

* Remove unnecessary imports.

* Replace some lambdas with Comparator.comparing

* Replace Runnables with lambdas.

* Use addAll instead of adding whole collection manually.

* Simplify boolean expressions.

* Remove redundant 'else'.

* Simplify some boolean conditions that are always true or false.

* Inline redundant local variables.

* Remove extraneous semicolons.

* Fix Javadoc errors.

* Replace anonymous classes with lambdas.

* Replace chain of 'if's with switch.

* Remove delaration of exception that is never thrown.

* Use String/StringBuilder properly.
2018-04-08 08:59:14 +08:00
melvinzhang 7263240ffd remove autoboxing as it is more performant 2017-06-17 11:40:17 +08:00
melvinzhang bbbdcac9ef add override annotation to overridden methods 2017-06-17 11:19:03 +08:00
melvinzhang f9718bc77b acceptPossibleLandCard and acceptPossibleSpellCard are overwritten in subclass
This reverts commit 803cbb5b21.
2017-02-08 09:24:26 +08:00
ShawnieBoy ace07b56b2 optimise imports 2017-02-07 13:51:09 +00:00
ShawnieBoy 803cbb5b21 acceptPossibleLandCard and acceptPossibleSpellCard always return true 2017-02-07 13:40:17 +00:00
melvinzhang c8f1262b45 remove trailing space from java code 2015-12-31 18:54:52 +08:00
lodici 656c518a79 avoid repeated calls to CardDefinitions.getSpellCards() from within loop. 2015-10-13 22:51:46 +01:00
lodici c9fad7657a refactor: extract method. 2015-10-13 00:45:31 +01:00
lodici 20973ea55f refactor: simplify by using Stream directly. 2015-10-13 00:40:07 +01:00
lodici aa6aa2bc42 Java 8 refactor: for-each -> stream. 2015-10-13 00:37:07 +01:00
lodici a5da121c35 rename getLandCards() to getNonBasicLandCards(). 2015-10-13 00:09:12 +01:00
melvinzhang c8ebbfbb77 replace manually managed standard/modern/legacy cube files with predefined formats 2015-06-20 17:33:31 +08:00
melvinzhang b25b66def2 merge CustomFormats into MagicCustomFormat 2015-06-20 13:30:01 +08:00
melvinzhang 282c1d809d rename MagicCubeDefinition to MagicCustomFormat, rename CubeDefinitions to CustomFormats 2015-06-20 10:26:31 +08:00
melvinzhang dc04c41e49 have MagicCubeDefinition extends MagicFormat 2015-06-20 10:05:42 +08:00
lodici 1f8dd4db1a Set default cube in RandomDeckGenerator; remove call to setCubeDefinition() in the contructor of the theme generator classes since always returns DEFAULT_CUBE; simplify code. 2015-05-26 17:45:25 +01:00
melvinzhang e2837e5be0 make non-deterministic rng private 2015-04-12 11:59:56 +08:00
melvinzhang 80b7df402e replace java.util.Random with MagicRandom 2015-03-08 20:45:58 +08:00
Lodici 2a6be6b08f add random deck generator dialog. 2014-09-23 15:29:52 +01:00
Lodici aaea93bfdb fix for issue 672. This addresses the case where the random deck generator was creating decks with hidden cards. 2014-09-09 18:05:32 +01:00
Lodici b2f1143b9e minor refactor. 2014-09-08 15:24:50 +01:00
Lodici 16703af3bb rename getCards() to getPlayableCards() for clarity. 2014-08-24 09:42:49 +01:00
melvin 2f687bd921 ensure space after if and for 2014-04-11 11:43:22 +08:00
Lodici 1326f340c1 refactor: rename DefaultDeckGenerator to RandomDeckGenerator. DefaultDeckGenerator conveys no information about what the class does. 2014-03-13 15:20:49 +00:00
Lodici 4ae4c9e043 refactor: renamed MagicPlayerProfile to MagicDeckProfile (see issue 506 for more details). 2014-03-13 10:24:17 +00:00
melvin fd78396651 rename 'non basic' to 'nonbasic' 2013-11-30 09:23:38 +08:00
melvin f6233ac7c6 replace MersenneTwisterFast with Xorshift 2013-09-24 11:55:52 +08:00
melvin 2b1ff9d829 added cascade to ability in script 2013-07-23 14:00:54 +08:00
melvin 64368e1b9a remove extraneous whitespace 2013-06-24 09:33:35 +08:00
melvin f1b27c586c convert to UNIX line endings 2013-04-13 10:32:25 +08:00
melvin afce87c6e3 replaced Array constant with initializer expression 2012-09-28 16:12:35 +08:00
melvin 9864cd3997 replace C style array delcaration with Java style 2012-09-28 16:09:47 +08:00
melvin 631dd73e4b infer final annotation for local variables 2012-09-28 16:04:12 +08:00
melvin dcc8d38484 optimized imports 2012-09-27 14:11:44 +08:00
melvin d853236bd3 replace MagicAbility.values with MagicAbility.CORE 2012-09-22 18:32:22 +08:00
melvin 83c9fc56bc convert tab to four spaces 2012-08-26 16:55:32 +08:00
melvin 40fca06a61 removed MagicColorType 2012-07-03 17:07:46 +08:00
melvin 2cd2205a98 changed colorText to static 2012-06-13 14:32:47 +08:00
melvin 0a2d6bb22c convert CubeDefinitions to a static class 2011-11-23 13:59:43 +08:00
melvin 161e3d5675 convert CardDefinitions and TokenCardDefinitions to a static class 2011-11-23 13:49:13 +08:00
melvin 9c19a17776 moved array constants to static final members 2011-11-13 20:43:18 +08:00
melvin cf15a6af5a changed error message to print to System.err instead of System.out 2011-11-11 11:56:32 +08:00
wait321 2ebcf61159 added token madness deck generator 2011-10-22 09:03:03 -07:00
wait321 86d6b5c39e added white metal deck generator. removed imports and minor changes to other generators 2011-10-22 08:35:04 -07:00
wait321 6ceb7b33e2 made saint and hero generator stronger 2011-10-22 08:08:37 -07:00
wait321 9d2106ad6e added mono ability deck generator 2011-10-21 23:04:03 -07:00
wait321 f410d2f04e made mono tribal generator more use mana cost restrictions 2011-10-21 22:53:49 -07:00
wait321 f9b3b24983 added mono tribal deck generator. removed goblin deck generator (too weak). made deck generators create new instance for every get so tribal deck is reset 2011-10-21 22:35:25 -07:00