More use of Visitor pattern - allowing iteration over all cards in the game without allocating a temporary collection.

This commit is contained in:
Myrd
2014-12-31 03:19:41 +00:00
parent 9f144f175e
commit 648756d1b8
7 changed files with 94 additions and 61 deletions

View File

@@ -0,0 +1,11 @@
package forge.util;
public abstract class Visitor<T> {
public abstract void visit(T object);
public void visitAll(Iterable<? extends T> objects) {
for (T obj : objects) {
visit(obj);
}
}
}