Remove a bot when it quits.
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / data / Bot.java
index 33bec20..724f0e0 100644 (file)
 package net.pterodactylus.xdcc.data;
 
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.Map;
 
-import com.beust.jcommander.internal.Maps;
+import com.google.common.collect.Maps;
 
 /**
  * A bot is a client in a {@link Network} that carries {@link Pack}s which are
@@ -28,7 +29,7 @@ import com.beust.jcommander.internal.Maps;
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public class Bot {
+public class Bot implements Iterable<Pack> {
 
        /** The network this bot is on. */
        private final Network network;
@@ -111,6 +112,15 @@ public class Bot {
        }
 
        //
+       // ITERABLE METHODS
+       //
+
+       @Override
+       public Iterator<Pack> iterator() {
+               return packs.values().iterator();
+       }
+
+       //
        // OBJECT METHODS
        //