-
Notifications
You must be signed in to change notification settings - Fork 0
/
floor.h
43 lines (36 loc) · 1.28 KB
/
floor.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
// floor.h -- Header file for floor.cpp
#ifndef __FLOOR_H
#define __FLOOR_H 1 // Prevent multiple #includes
#include "person.h"
class floor {
private:
int floorNumber; // Lobby is floor 0
int up, down; // 1 = up or down buttons pressed
int np; // Number of people waiting for elev
public:
floor();
void setFloorNumber(int n) { floorNumber = n; }
int downButton(void) { return down; }
int upButton(void) { return up; }
void resetUpButton(void) { up = 0; }
void resetDownButton(void) { down = 0; }
int getNumWaiting(void) { return np; }
void setUpButton(void);
void setDownButton(void);
void showFloor(persCollection &thePersons);
};
class floorCollection {
private:
floor *fa; // Array of floor objects
public:
floorCollection();
void showFloors(persCollection &thePersons);
void resetButton(int direction, int floorNumber);
int signalUp(int floorNumber);
int signalDown(int floorNumber);
int signalSameDir(int direction, int floorNumber);
int avgWaiting(void);
};
#endif // __FLOOR_H
// Copyright (c) 1990 by Tom Swan. All rights reserved
// Revision 1.00 Date: 09/18/1990 Time: 09:41 am