mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
fixes + optimizations + allow games to be paused and resumed
This commit is contained in:
parent
8fd03a5bb5
commit
7c69bc6f30
44 changed files with 430 additions and 331 deletions
|
|
@ -157,7 +157,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
|
||||
@Override
|
||||
public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) {
|
||||
Zone fromZone = game.getZone(objectId);
|
||||
Zone fromZone = game.getState().getZone(objectId);
|
||||
Player controller = game.getPlayer(controllerId);
|
||||
if (controller != null && controller.removeFromBattlefield(this, game)) {
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, controllerId, fromZone, toZone);
|
||||
|
|
@ -187,7 +187,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
}
|
||||
game.setZone(objectId, event.getToZone());
|
||||
game.fireEvent(event);
|
||||
return game.getZone(objectId) == toZone;
|
||||
return game.getState().getZone(objectId) == toZone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
|
||||
@Override
|
||||
public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) {
|
||||
Zone fromZone = game.getZone(objectId);
|
||||
Zone fromZone = game.getState().getZone(objectId);
|
||||
Player controller = game.getPlayer(controllerId);
|
||||
if (controller != null && controller.removeFromBattlefield(this, game)) {
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this, sourceId, ownerId, fromZone, Zone.EXILED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue