⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 elevator.h

📁 这是一个模拟电梯的程序
💻 H
字号:
//Elevator class definition
#ifndef ELEVATOR_H
#define ELEVATOR_H

#include "elevatorButton.h"
#include"door.h"
#include"bell.h"

class Floor;
class Person;

class Elevator{

public:
	Elevator(Floor &,Floor &);
	~Elevator();
	void summonElevator(int);//request to service floor
	void prepareToLeave(bool);//prepare to leave
	void processTime(int);//give time to elevator
	void passengerEnters(Person * const);//board a passenger
	void passengerExits();
	ElevatorButton elevatorButton;

private:

	void processPossibleArrival();
	void processPossibleDeparture();
	void arriveAtFloor(Floor &);
	void move();

	static const int ELEVATOR_TRAVEL_TIME;
	static const int UP;
	static const int DOWN;

	int currentBuildingClockTime;
	bool moving;
	int direction;
	int currentFloor;
	int arrivalTime;
	bool floor1NeedsService;
	bool floor2NeedsService;


	Floor &floor1Ref;
	Floor &floor2Ref;
	Person *passengerPtr;
	Door door;
	Bell bell;

};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -