1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-12 04:39:23 +00:00

préempté ?

This commit is contained in:
Aethor
2018-06-20 17:49:18 +02:00
parent 120fd7f0d8
commit df740634ad
3 changed files with 18 additions and 6 deletions

View File

@ -5,6 +5,7 @@
#include <string.h>
#include <pthread.h>
#include "Resident.h"
#include "../SharedData/SharedData.h"
GETTER(Resident, char *, name);
GETTER(Resident, int, id);
@ -12,11 +13,17 @@ GETTER(Resident, int, apartment_floor);
void * runnable_Resident(void * void_this){
Resident * this = (Resident*) void_this;
SharedData* data = GET_INSTANCE(SharedData);
Passenger passenger;
AGENT_OPTIONS
AGENT_OPTIONS;
passenger.resident = this;
passenger.type = RESIDENT;
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);
return NULL;
}