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:
@ -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,
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user