mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
remove input call won't update the input queue.
it will get updated anyway - by unlock for instance
This commit is contained in:
@@ -85,13 +85,10 @@ public class InputQueue extends MyObservable implements java.io.Serializable {
|
|||||||
* a boolean.
|
* a boolean.
|
||||||
*/
|
*/
|
||||||
final void removeInput(Input inp) {
|
final void removeInput(Input inp) {
|
||||||
FThreads.assertExecutedByEdt(false);
|
|
||||||
Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
|
Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
|
||||||
|
|
||||||
if( topMostInput != inp )
|
if( topMostInput != inp )
|
||||||
throw new RuntimeException("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
|
throw new RuntimeException("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
|
||||||
|
|
||||||
this.updateObservers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isEmpty() {
|
public final boolean isEmpty() {
|
||||||
|
|||||||
@@ -30,16 +30,10 @@ public abstract class InputSyncronizedBase extends InputBase implements InputSyn
|
|||||||
protected final void stop() {
|
protected final void stop() {
|
||||||
// ensure input won't accept any user actions.
|
// ensure input won't accept any user actions.
|
||||||
FThreads.invokeInEdtNowOrLater(new Runnable() { @Override public void run() { setFinished(); } });
|
FThreads.invokeInEdtNowOrLater(new Runnable() { @Override public void run() { setFinished(); } });
|
||||||
|
|
||||||
// this will update input proxy, so there might be anything happening in the thread
|
// thread irrelevant
|
||||||
getQueue().invokeGameAction( new Runnable() {
|
getQueue().removeInput(InputSyncronizedBase.this);
|
||||||
@Override
|
cdlDone.countDown();
|
||||||
public void run() {
|
|
||||||
// this will update input proxy, so there might be anything happening in the thread
|
|
||||||
getQueue().removeInput(InputSyncronizedBase.this);
|
|
||||||
cdlDone.countDown();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user