#include<queue>
class Elevator
{
private:
int CurrentTime; //当前时间
int CurrentFloor; //当前楼层
queue<int> Destination; //目标队列
int CurrentDirection; //当前方向,<0下,>0上
public:
Elevator(); //构造
~Elevator(); //析构
int GetCurrentFloor(); //当前楼层
void SetNextDestination(int); //接受下一层指令
}
Elevator::~Elevator()
{
cout<<"Elevator has been uninstalled!"<<endl;
}
Elevator::int GetCurrentFloor()
{
return CurrentFloor;
}
Elevator::void SetNextDestination(int Next)
{
Destination.push(Next);
CurrentDirection=Next-CurrentFloor;
}
原文:https://www.cnblogs.com/M031702113/p/8996797.html