-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathliftController.h
44 lines (34 loc) · 1.03 KB
/
liftController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef LIFT_CONTROLLER
#define LIFT_CONTROLLER
#include "person.h"
#include "logger.h"
#include "liftMailbox.h"
#include "liftControllerMailbox.h"
#include <vector>
class LiftController {
public:
LiftController(unsigned int liftsCount);
~LiftController();
int work();
void newLiftArrival(LiftState);
void newPersonArrival(Person);
void endPeopleGenerator();
private:
Logger log;
bool continuarSimulacion;
LiftControllerMailbox mailbox;
std::vector<LiftState> liftStates;
std::vector<Person> peopleWaiting;
std::vector<LiftMailbox> liftMailboxes;
bool simRunning();
bool peopleWaitingUp(unsigned int currentFloor);
bool peopleWaitingDown(unsigned int currentFloor);
bool anyLiftMoving();
void moveLiftUp(unsigned int liftId);
void moveLiftDown(unsigned int liftId);
void getOnUp(unsigned int liftId);
void getOnDown(unsigned int liftId);
void logPersonArrival(Person);
void makeNextLiftMovement(LiftState, MovingDirection preferredDirection);
};
#endif