forked from External/mage
tests: added verify check for wrong predicates usage in filters (ClassCastException errors like #12774)
This commit is contained in:
parent
e1f76c2b6c
commit
cd51954208
14 changed files with 176 additions and 91 deletions
63
Mage/src/main/java/mage/game/FakeGame.java
Normal file
63
Mage/src/main/java/mage/game/FakeGame.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package mage.game;
|
||||
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.game.match.MatchType;
|
||||
import mage.game.mulligan.MulliganType;
|
||||
|
||||
/**
|
||||
* Fake game for tests and data check, do nothing.
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class FakeGame extends GameImpl {
|
||||
|
||||
private int numPlayers;
|
||||
|
||||
public FakeGame() {
|
||||
super(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ALL, MulliganType.GAME_DEFAULT.getMulligan(0), 60, 20, 7);
|
||||
}
|
||||
|
||||
public FakeGame(final FakeGame game) {
|
||||
super(game);
|
||||
this.numPlayers = game.numPlayers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MatchType getGameType() {
|
||||
return new FakeGameType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumPlayers() {
|
||||
return numPlayers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FakeGame copy() {
|
||||
return new FakeGame(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FakeGameType extends MatchType {
|
||||
|
||||
public FakeGameType() {
|
||||
this.name = "Test Game Type";
|
||||
this.maxPlayers = 10;
|
||||
this.minPlayers = 3;
|
||||
this.numTeams = 0;
|
||||
this.useAttackOption = true;
|
||||
this.useRange = true;
|
||||
this.sideboardingAllowed = true;
|
||||
}
|
||||
|
||||
protected FakeGameType(final FakeGameType matchType) {
|
||||
super(matchType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FakeGameType copy() {
|
||||
return new FakeGameType(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue