refactor: expose Player->incrementLandsPlayed for some custom effects. (#10632)

* Expose Player->incrementLandsPlayed for some custom effects.
* also expose resetLandsPlayed
This commit is contained in:
Susucre 2023-07-17 01:53:22 +02:00 committed by GitHub
parent a5dbf30605
commit d658bf2265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 2 deletions

View file

@ -485,7 +485,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public void beginTurn(Game game) {
this.landsPlayed = 0;
resetLandsPlayed();
updateRange(game);
}
@ -1285,7 +1285,7 @@ public abstract class PlayerImpl implements Player, Serializable {
game.fireEvent(landEventBefore);
if (moveCards(card, Zone.BATTLEFIELD, playLandAbility, game, false, false, false, null)) {
landsPlayed++;
incrementLandsPlayed();
GameEvent landEventAfter = GameEvent.getEvent(GameEvent.EventType.LAND_PLAYED,
card.getId(), playLandAbility, playerId, activationStatus.getApprovingObject());
landEventAfter.setZone(cardZoneBefore);
@ -1647,6 +1647,16 @@ public abstract class PlayerImpl implements Player, Serializable {
return useable;
}
@Override
public void incrementLandsPlayed() {
landsPlayed++;
}
@Override
public void resetLandsPlayed() {
landsPlayed = 0;
}
@Override
public int getLandsPlayed() {
return landsPlayed;