From caa49d174b48e48c675ba0e6409c4daf92445618 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sat, 18 Jun 2011 03:05:35 +0200 Subject: Finished network game setup (without starting) git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@456 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/util/Event1.java | 2 +- src/jrummikub/util/Event2.java | 2 +- src/jrummikub/util/Event3.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/jrummikub/util') 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 implements IEvent1 { * the event parameter */ public void emit(T value) { - for (IListener1 listener : listeners) { + for (IListener1 listener : new HashSet>(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 implements IEvent2 { * the second event parameter */ public void emit(T1 value1, T2 value2) { - for (IListener2 listener : listeners) { + for (IListener2 listener : new HashSet>(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 implements IEvent3 { * the third event parameter */ public void emit(T1 value1, T2 value2, T3 value3) { - for (IListener3 listener : listeners) { + for (IListener3 listener : new HashSet>(listeners)) { listener.handle(value1, value2, value3); } } -- cgit v1.2.3