espelhamento de
https://gitlab.com/klmp200/LO41.git
sincronizado 2025-07-12 04:39:23 +00:00
c'est plus beau
Esse commit está contido em:
@ -8,13 +8,14 @@
|
||||
#include "../SharedData/SharedData.h"
|
||||
|
||||
GETTER(Resident, char *, name);
|
||||
GETTER(Resident, int, destination);
|
||||
GETTER(Resident, int, id);
|
||||
GETTER(Resident, int, apartment_floor);
|
||||
|
||||
void * runnable_Resident(void * void_this){
|
||||
Resident * this = (Resident*) void_this;
|
||||
SharedData* data = GET_INSTANCE(SharedData);
|
||||
Passenger * passenger = NEW(Passenger, this, RESIDENT);
|
||||
Passenger * passenger = NEW(Passenger, (void*) this, RESIDENT);
|
||||
|
||||
AGENT_OPTIONS;
|
||||
|
||||
@ -24,6 +25,7 @@ void * runnable_Resident(void * void_this){
|
||||
printf("Je suis le resident %s et je suis a l'etage %d en direction de l'etage %d\n",
|
||||
this->name, this->apartment_floor, this->destination);
|
||||
data->main_building->go_to_floor(data->main_building, this->position, this->destination, passenger);
|
||||
DELETE(passenger);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -43,10 +45,11 @@ Resident *_init_Resident(int id, char* name, int apartment_floor, int destinatio
|
||||
new_resident->destination = destination;
|
||||
|
||||
LINK_ALL(Resident, new_resident,
|
||||
get_name,
|
||||
get_id,
|
||||
runnable,
|
||||
get_apartment_floor
|
||||
get_name,
|
||||
get_destination,
|
||||
get_id,
|
||||
runnable,
|
||||
get_apartment_floor
|
||||
)
|
||||
|
||||
return new_resident;
|
||||
|
@ -18,6 +18,7 @@ typedef struct o_Resident {
|
||||
PUBLIC char * (*get_name)(_THIS(Resident));
|
||||
PUBLIC int (*get_id)(_THIS(Resident));
|
||||
PUBLIC int (*get_apartment_floor)(_THIS(Resident));
|
||||
PUBLIC int (*get_destination)(_THIS(Resident));
|
||||
|
||||
DESTRUCTOR(Resident);
|
||||
} Resident;
|
||||
|
Referência em uma nova issue
Block a user