summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/util
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-06-18 03:05:35 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-06-18 03:05:35 +0200
commitcaa49d174b48e48c675ba0e6409c4daf92445618 (patch)
tree1830197016893a754ddc2327634213512c48236b /src/jrummikub/util
parent626f4bd9ab6f9143851768b3b2f0a756a9d45f01 (diff)
downloadJRummikub-caa49d174b48e48c675ba0e6409c4daf92445618.tar
JRummikub-caa49d174b48e48c675ba0e6409c4daf92445618.zip
Finished network game setup (without starting)
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@456 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/util')
-rw-r--r--src/jrummikub/util/Event1.java2
-rw-r--r--src/jrummikub/util/Event2.java2
-rw-r--r--src/jrummikub/util/Event3.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/jrummikub/util/Event1.java b/src/jrummikub/util/Event1.java
index 5e3391c..f93d519 100644
--- a/src/jrummikub/util/Event1.java
+++ b/src/jrummikub/util/Event1.java
@@ -35,7 +35,7 @@ public class Event1<T> implements IEvent1<T> {
* the event parameter
*/
public void emit(T value) {
- for (IListener1<T> listener : listeners) {
+ for (IListener1<T> listener : new HashSet<IListener1<T>>(listeners)) {
listener.handle(value);
}
}
diff --git a/src/jrummikub/util/Event2.java b/src/jrummikub/util/Event2.java
index 9bcee43..139f19f 100644
--- a/src/jrummikub/util/Event2.java
+++ b/src/jrummikub/util/Event2.java
@@ -39,7 +39,7 @@ public class Event2<T1, T2> implements IEvent2<T1, T2> {
* the second event parameter
*/
public void emit(T1 value1, T2 value2) {
- for (IListener2<T1, T2> listener : listeners) {
+ for (IListener2<T1, T2> listener : new HashSet<IListener2<T1, T2>>(listeners)) {
listener.handle(value1, value2);
}
}
diff --git a/src/jrummikub/util/Event3.java b/src/jrummikub/util/Event3.java
index 38cdd07..9510e48 100644
--- a/src/jrummikub/util/Event3.java
+++ b/src/jrummikub/util/Event3.java
@@ -43,7 +43,7 @@ public class Event3<T1, T2, T3> implements IEvent3<T1, T2, T3> {
* the third event parameter
*/
public void emit(T1 value1, T2 value2, T3 value3) {
- for (IListener3<T1, T2, T3> listener : listeners) {
+ for (IListener3<T1, T2, T3> listener : new HashSet<IListener3<T1, T2, T3>>(listeners)) {
listener.handle(value1, value2, value3);
}
}