// File: Main.java
// Time-stamp: "2005-08-18 14:25:46 calvanese"
// Purpose: Written exam 28/6/2005 - BSC in Production Engineering
//          Main program for testing the solution

import java.io.*;

public class Main {

  public static BikePool readBikePool(String filename) throws IOException {
    FileReader f = new FileReader(filename);
    BufferedReader br = new BufferedReader(f);

    BikePool bp = new BikePool("shop", 10);
    int count = 0;
    Bike b = Bike.readBike(br);
    while (b != null && count < 10) {
      bp.newBike(b);
      b = Bike.readBike(br);
      count++;
    }

    f.close(); // or equivalently br.close();
    return bp;
  }


  public static void main (String[] args) throws IOException {
    
    BikePool bp = readBikePool("bikes.txt");

    ClientBikePool.colorsForWeight(bp,  70, "colors-070.txt");
    ClientBikePool.colorsForWeight(bp,  80, "colors-080.txt");
    ClientBikePool.colorsForWeight(bp,  90, "colors-090.txt");
    ClientBikePool.colorsForWeight(bp, 100, "colors-100.txt");
    ClientBikePool.colorsForWeight(bp, 110, "colors-110.txt");
    ClientBikePool.colorsForWeight(bp, 115, "colors-115.txt");
    ClientBikePool.colorsForWeight(bp, 170, "colors-170.txt");
    ClientBikePool.colorsForWeight(bp, 180, "colors-180.txt");
    ClientBikePool.colorsForWeight(bp, 210, "colors-210.txt");

  }
}
