package org.academiadecodigo.carcrash.cars;

public class CarFactory {

    public static Car getNewCar() {
        Brand newBrand = Brand.values()[(int)(Math.random() * Brand.values().length)];
        switch (newBrand) {
            case BEETLE:
                return new Beetle();
            case FERRARI:
                return new Ferrari();
            default:
                return new Beetle();
        }

    }
}
