package org.academiadecodigo.carcrash.cars;

public class CarFactory {

    public static Car getNewCar() {
        CarType newType = CarType.values()[(int)(Math.random() * CarType.values().length)];

        switch (newType) {
            case FERRARI:
                return new Ferrari();
            case TELEPORTER:
                return new Teleporter();
            case BEETLE:
                return new Beetle();
            default:
                return new Beetle();
        }
    }
}
