diff --git a/car.c b/car.c index 5568c59..b1cdcae 100644 --- a/car.c +++ b/car.c @@ -9,6 +9,14 @@ */ #include "car.h" +struct CarData { + CarType type; + Color color; + double fill_level; + double acceleration_rate; + int speed; +}; + Car get_car(CarType carType) { Car car = {carType, RED, 0.0, 0.0, 0}; return car; diff --git a/car.h b/car.h index 09b462c..42ccbca 100644 --- a/car.h +++ b/car.h @@ -8,18 +8,13 @@ * ---------------------------------------------------------- */ -typedef struct CarImplementation* Car; +#ifndef ___CAR_H +#define ___CAR_H + +typedef struct CarData* Car; typedef enum { AIXAM, FIAT_MULTIPLA, JEEP } CarType; typedef enum { RED, GREEN, BLUE, ORANGE, SILVER, BLACK } Color; -struct CarImplementation { - CarType type; - Color color; - double fill_level; - double acceleration_rate; - int speed; -}; - Car get_car(CarType type); CarType get_type(Car car); Color get_color(Car car); @@ -28,4 +23,6 @@ double get_acceleration_rate(Car car); int get_speed(Car car); void set_acceleration_rate(Car car, double acceleration_rate); void accelerate(Car car); -void init(); \ No newline at end of file +void init(); + +#endif \ No newline at end of file