From: David ‘Bombe’ Roden Date: Tue, 9 Apr 2013 04:59:18 +0000 (+0200) Subject: Make a bot deliver all its packs when it’s being iterated over. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=afec2edc48b0151823ad0696965e533b7dec9184;p=xudocci.git Make a bot deliver all its packs when it’s being iterated over. --- diff --git a/src/main/java/net/pterodactylus/xdcc/data/Bot.java b/src/main/java/net/pterodactylus/xdcc/data/Bot.java index 33bec20..46bca18 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Bot.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Bot.java @@ -18,6 +18,7 @@ package net.pterodactylus.xdcc.data; import java.util.Collection; +import java.util.Iterator; import java.util.Map; import com.beust.jcommander.internal.Maps; @@ -28,7 +29,7 @@ import com.beust.jcommander.internal.Maps; * * @author David ‘Bombe’ Roden */ -public class Bot { +public class Bot implements Iterable { /** The network this bot is on. */ private final Network network; @@ -111,6 +112,15 @@ public class Bot { } // + // ITERABLE METHODS + // + + @Override + public Iterator iterator() { + return packs.values().iterator(); + } + + // // OBJECT METHODS //