Commits

John Eriksson committed 30ac4d7

Simulator is now iterable

  • Participants
  • Parent commits 80715b1

Comments (0)

Files changed (1)

File src/se/kth/csc/inda11/remains/simulator/Simulator.java

  */
 package se.kth.csc.inda11.remains.simulator;
 
+import java.awt.Point;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Map.Entry;
 
 /**
  *
  * @author John
  */
-public abstract class Simulator {
+public abstract class Simulator implements Iterable<Map.Entry<java.awt.Point, Simulator.Cell>> {
 
     public enum Cell { // WARNING: some code in the GUI
         // currently depends on the order
     public abstract void removeCell(int x, int y);
     public abstract void reset();
     public abstract Iterator<Map.Entry<java.awt.Point, Simulator.Cell>> cellIterator();
+
+    @Override
+    public Iterator<Entry<Point, Cell>> iterator() {
+        return cellIterator();
+    }
+    
+    
     
 }