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

Meilleure gestion des scénari

This commit is contained in:
2018-06-10 17:57:39 +02:00
parent 74194d46cb
commit bd5860579e
8 changed files with 60 additions and 45 deletions

View File

@ -15,13 +15,14 @@ void _free__Resident(THIS(Resident)){
free(this);
}
Resident *_init_Resident(int id, char* name, int apartment_floor){
Resident *_init_Resident(int id, char* name, int apartment_floor, int destination){
/* If the destination is the same as the apartment_floor or negative, the resident will not move */
Resident * new_resident = malloc_or_die(sizeof(Resident));
new_resident->name = strdup(name);
new_resident->id = id;
new_resident->apartment_floor = apartment_floor;
new_resident->position = new_resident->apartment_floor;
new_resident->destination = -1;
new_resident->destination = destination;
LINK_ALL(Resident, new_resident,
get_name,

View File

@ -23,6 +23,6 @@ typedef struct o_Resident {
FRIENDLY(name, Building)
Resident *_init_Resident(int id, char * name, int apartment_floor);
Resident *_init_Resident(int id, char * name, int apartment_floor, int destination);
#endif //LO41_RESIDENT_H