07-car/car.h
2024-11-14 15:11:05 +01:00

31 lines
No EOL
896 B
C

/*----------------------------------------------------------
* HTBLA-Leonding
* ---------------------------------------------------------
* Author: Marc Tismonar
* ----------------------------------------------------------
* Description:
* Car abstract data type demo.
* ----------------------------------------------------------
*/
typedef struct CarImplementation* 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);
double get_fill_level(Car car);
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();