/**
 * Simple class that models a race between two dots.
 *   @author Dave Reed
 *   @version 1/25/17
 */
public class DotRace {
  private Dot redDot;
  private Dot blueDot;    

  /**
   * Constructs a dot race in which the step distance for each dot is limited.
   *   @param maxStep the maximum distance covered by a single step of a dot
   */
  public DotRace(int maxStep) {
    this.redDot = new Dot("red", maxStep);
    this.blueDot = new Dot("blue", maxStep);
  }
  
  /**
   * Reports the current position of the red dot.
   *   @return the red dot's poisition relative to the start (0)
   */
  public int getRedPosition() {
    return this.redDot.getPosition();
  }
    
  /**
   * Reports the current position of the blue dot.
   *   @return the blue dot's poisition relative to the start (0)
   */
  public int getBluePosition() {
    return this.blueDot.getPosition();
  }   

  /**
   * Simulates both dots taking a random step.
   */
  public void step() {
    this.redDot.step();
    this.blueDot.step();
  }
       
  /**
   * Prints the positions of the two dots.
   */
  public void showStatus() {
    this.redDot.showPosition();
    this.blueDot.showPosition();
  }
  
  /**
   * Resets the positions of the two dots back to the start (0).
   */
  public void reset() {
    this.redDot.reset();
    this.blueDot.reset();
  }
}
