started with new rover, bt still not worknig:(
[des2015.git] / dsl / runtime / src / nl / ru / des / ColorMemory.java
index cec193e..61b0f2b 100644 (file)
@@ -1,14 +1,26 @@
 package nl.ru.des;
 
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import lejos.robotics.SampleProvider;
 
 public class ColorMemory {
 
+       private Set<Integer> colors;
+       
        public ColorMemory(SampleProvider color) {
+               colors = new HashSet<Integer>();
        }
 
-       public boolean containsAll(int[] is) {
-               return false;
+       public void addColor(int current) {
+               if(!colors.contains(current)){
+                       colors.add(current);
+               }
+       }
+       public boolean containsAll(List<Integer> is) {
+               return colors.containsAll(is);
        }
 
 }