import java.util.ArrayList;

/**
 * This class simulates a dot race.  At every step, each dot moves forward a 
 * random amount (as determined by the roll of a die).
 * 
 * @author Dave Reed 
 * @version 2/25/13
 */
public class DotRaceList {
    private ArrayList<Dot> dots;

    public DotRaceList(int maxStep) {
        this.dots = new ArrayList<Dot>();
        this.dots.add(new Dot("red", maxStep));
        this.dots.add(new Dot("blue", maxStep));
    }
    
    public void step() {
        for (Dot nextDot : this.dots) {
                nextDot.step();
                nextDot.showPosition();
        }
    }
    
    public void reset() {
        for (Dot nextDot : this.dots) {
            nextDot.reset();
            nextDot.showPosition();
        }
    }
}
