mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Fixed some more possible exception bugs.
This commit is contained in:
parent
1ec61abb8e
commit
74c310de3e
4 changed files with 35 additions and 32 deletions
|
@ -4,17 +4,16 @@ import mage.game.Table;
|
|||
import mage.game.Table.TableRecorder;
|
||||
import mage.game.result.ResultProtos.TableProto;
|
||||
import mage.server.UserManager;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class TableRecorderImpl implements TableRecorder {
|
||||
|
||||
private static TableRecorderImpl INSTANCE = new TableRecorderImpl();
|
||||
private static final Logger logger = Logger.getLogger(TableRecorderImpl.class);
|
||||
private final static TableRecorderImpl INSTANCE = new TableRecorderImpl();
|
||||
|
||||
public static TableRecorderImpl getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void record(Table table) {
|
||||
TableProto proto = table.toProto();
|
||||
TableRecordRepository.instance.add(new TableRecord(proto, proto.getEndTimeMs()));
|
||||
|
|
|
@ -112,6 +112,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
|
|||
}
|
||||
}
|
||||
String choosenType = choiceImpl.getChoice();
|
||||
if (choosenType != null) {
|
||||
game.informPlayers(storageMatrix.getLogName() + ": " + player.getLogName() + " chose to untap " + choosenType);
|
||||
|
||||
if (choosenType.equals(CardType.ARTIFACT.toString())) {
|
||||
|
@ -125,6 +126,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (applies) {
|
||||
return !permanent.getCardType().contains(type);
|
||||
}
|
||||
|
|
|
@ -108,8 +108,10 @@ class SarkhanTheMadRevealAndDrawEffect extends OneShotEffect {
|
|||
Card card = controller.getLibrary().getFromTop(game);
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (card != null) {
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
controller.moveCards(card, Zone.HAND, source, game);
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, false);
|
||||
}
|
||||
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.game;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -65,6 +64,7 @@ public class Table implements Serializable {
|
|||
private TableRecorder recorder;
|
||||
|
||||
public interface TableRecorder {
|
||||
|
||||
void record(Table table);
|
||||
};
|
||||
|
||||
|
@ -138,8 +138,8 @@ public class Table implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* All activities of the table end
|
||||
* (only replay of games (if active) and display tournament results)
|
||||
* All activities of the table end (only replay of games (if active) and
|
||||
* display tournament results)
|
||||
*
|
||||
*/
|
||||
public void closeTable() {
|
||||
|
|
Loading…
Reference in a new issue