Added a game end dialog, that shows the result of the finished game.

This commit is contained in:
LevelX2 2013-08-07 16:50:25 +02:00
parent 19726268ff
commit ae44981cfa
19 changed files with 922 additions and 4 deletions

View file

@ -151,6 +151,7 @@ public interface Game extends MageItem, Serializable {
void informPlayer(Player player, String message);
void debugMessage(String message);
void fireErrorEvent(String message, Exception ex);
void fireGameEndInfo();
//game event methods
void fireEvent(GameEvent event);

View file

@ -1551,6 +1551,15 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
tableEventSource.fireTableEvent(EventType.UPDATE, null, this);
}
@Override
public void fireGameEndInfo() {
if (simulation) {
return;
}
logger.trace("fireGameEndIfo");
tableEventSource.fireTableEvent(EventType.END_GAME_INFO, null, this);
}
@Override
public void fireErrorEvent(String message, Exception ex) {
tableEventSource.fireTableEvent(EventType.ERROR, message, ex, this);

View file

@ -45,7 +45,7 @@ import mage.game.tournament.TournamentPairing;
public class TableEvent extends EventObject implements ExternalEvent, Serializable {
public enum EventType {
UPDATE, INFO, STATUS, REVEAL, LOOK, START_DRAFT, START_MATCH, SIDEBOARD, CONSTRUCT, SUBMIT_DECK, END, ERROR,
UPDATE, INFO, STATUS, START_DRAFT, START_MATCH, SIDEBOARD, CONSTRUCT, SUBMIT_DECK, END, END_GAME_INFO, ERROR,
INIT_TIMER, RESUME_TIMER, PAUSE_TIMER
}

View file

@ -208,6 +208,7 @@ public abstract class MatchImpl implements Match {
}
}
}
game.fireGameEndInfo();
}
@Override