mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
GameLog uses a common observable
This commit is contained in:
@@ -20,11 +20,11 @@ package forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Observable;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import forge.game.event.IGameEventVisitor;
|
||||
import forge.game.phase.Combat;
|
||||
import forge.util.MyObservable;
|
||||
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ import forge.util.MyObservable;
|
||||
* @author Forge
|
||||
* @version $Id: GameLog.java 12297 2011-11-28 19:56:47Z slapshot5 $
|
||||
*/
|
||||
public class GameLog extends MyObservable {
|
||||
public class GameLog extends Observable {
|
||||
private List<GameLogEntry> log = new ArrayList<GameLogEntry>();
|
||||
|
||||
private GameLogFormatter formatter = new GameLogFormatter(this);
|
||||
@@ -63,13 +63,13 @@ public class GameLog extends MyObservable {
|
||||
* @param type the level
|
||||
*/
|
||||
public void add(final GameLogEntryType type, final String message) {
|
||||
log.add(new GameLogEntry(type, message));
|
||||
this.updateObservers();
|
||||
add(new GameLogEntry(type, message));
|
||||
}
|
||||
|
||||
void add(GameLogEntry entry) {
|
||||
log.add(entry);
|
||||
this.updateObservers();
|
||||
this.setChanged();
|
||||
this.notifyObservers();
|
||||
}
|
||||
|
||||
public String getLogText(final GameLogEntryType logLevel) {
|
||||
|
||||
@@ -34,9 +34,7 @@ import forge.util.MyObservable;
|
||||
* @author Forge
|
||||
* @version $Id$
|
||||
*/
|
||||
public class InputQueue extends MyObservable implements java.io.Serializable {
|
||||
/** Constant <code>serialVersionUID=3955194449319994301L</code>. */
|
||||
private static final long serialVersionUID = 3955194449319994301L;
|
||||
public class InputQueue extends MyObservable {
|
||||
|
||||
private final BlockingDeque<InputSynchronized> inputStack = new LinkedBlockingDeque<InputSynchronized>();
|
||||
private final InputLockUI inputLock;
|
||||
@@ -50,14 +48,6 @@ public class InputQueue extends MyObservable implements java.io.Serializable {
|
||||
return inputStack.isEmpty() ? null : this.inputStack.peek();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* resetInput.
|
||||
* </p>
|
||||
*
|
||||
* @param update
|
||||
* a boolean.
|
||||
*/
|
||||
public final void removeInput(Input inp) {
|
||||
Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
|
||||
|
||||
|
||||
@@ -430,7 +430,6 @@ public final class GuiDisplayUtil {
|
||||
// Human player is choosing targets for an ability controlled by chosen player.
|
||||
sa.setActivatingPlayer(p);
|
||||
HumanPlay.playSaWithoutPayingManaCost(game, sa);
|
||||
Singletons.getControl().getInputQueue().updateObservers(); // priority can be on AI side, need this update for that case
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user