1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-11 20:29:24 +00:00

ElevatorPassenger c'est plus propre, c'est ça le vrai polymorphisme du C++ en C

This commit is contained in:
2018-06-18 15:51:48 +02:00
parent 575defc5fc
commit b001cb1a91
7 changed files with 54 additions and 33 deletions

23
Passenger/Passenger.h Normal file
View File

@ -0,0 +1,23 @@
//
// Created by Antoine Bartuccio on 18/06/2018.
//
#ifndef LO41_PASSENGER_H
#define LO41_PASSENGER_H
#include "../Resident/Resident.h"
#include "../Visitor/Visitor.h"
typedef enum {RESIDENT, VISITOR} PASSENGER_TYPE;
typedef union u_Passenger {
Resident * resident;
Visitor * visitor;
} Passenger;
typedef struct s_ElevatorPassenger {
PASSENGER_TYPE type;
Passenger passenger;
} ElevatorPassenger;
#endif //LO41_PASSENGER_H