added some functions
This commit is contained in:
parent
aae3fcf4fd
commit
e35b7bd136
1 changed files with 28 additions and 0 deletions
28
car.c
28
car.c
|
|
@ -13,3 +13,31 @@ Car get_car(CarType carType) {
|
|||
Car car = {carType, RED, 0.0, 0.0, 0};
|
||||
return car;
|
||||
}
|
||||
|
||||
CarType get_type(Car car) {
|
||||
return car->type;
|
||||
}
|
||||
|
||||
Color get_color(Car car) {
|
||||
return car->color;
|
||||
}
|
||||
|
||||
double get_fill_level(Car car) {
|
||||
return car->fill_level;
|
||||
}
|
||||
|
||||
double get_acceleration_rate(Car car) {
|
||||
return car->acceleration_rate;
|
||||
}
|
||||
|
||||
int get_speed(Car car) {
|
||||
return car->speed;
|
||||
}
|
||||
|
||||
void set_acceleration_rate(Car car, double acceleration_rate) {
|
||||
car->acceleration_rate = acceleration_rate;
|
||||
}
|
||||
|
||||
void accelerate(Car car) {
|
||||
car->speed += 4;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue