elevator.h

来自「这个程序是对电梯的模拟」· C头文件 代码 · 共 66 行

H
66
字号
// Elevator.h: interface for the Elevator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ELEVATOR_H__B774ADA7_09F0_4980_8F06_2224DE47FE3B__INCLUDED_)
#define AFX_ELEVATOR_H__B774ADA7_09F0_4980_8F06_2224DE47FE3B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "DataInfo.h"
#include "People.h"
#include "Button.h"	// Added by ClassView
#include "Door.h"	// Added by ClassView
#include "Bell.h"	// Added by ClassView




class Elevator  
{
public:
	void BellRing();
	int GetStatus();
	void PeopleEnter(list<People *> &pl,int up);//up=true is the up
	void PeopleOut();
	bool IsPeopleEnter();
	bool IsPeopleOut();
	int GetFloorAt();
	bool IsGetTop();
	bool IsGetBottom();
	Elevator(int fcount=0,int num=-1);
	void Stop();
	void CloseDoor();
	void OpenDoor();
	virtual ~Elevator();


	static unsigned peopleLimit;

	list<People *> pList;  //people in elevator
    vector<Button *> numButton;  //数字按钮,在电梯初始化时根据建筑的层数确定
	Door door;

	int bfloors;    //楼层数,
	int floorAt;    //the variable is stand witch floor is this elevator at now.
	int status;     //-1——down,1——up,0——stop,
	int number;            //the elevator's number
	int  *runline;  //It's a array, and it lead this elevator to run,
	   //TT——Not stop,
	   //OUT——Some people will go out elevator,
	   //UP——Some people will go into elevator and up
	   //DOWN——Some people will go into elevator and up
       //UP_DOWN, OUT_UP, OUT_DOWN, OUT_UP_DOWN
	   


private:
	Bell bell;
	Button doorOpenButton;  //开门按钮
	Button doorCloseButton; //关门按钮
};

#endif // !defined(AFX_ELEVATOR_H__B774ADA7_09F0_4980_8F06_2224DE47FE3B__INCLUDED_)

⌨️ 快捷键说明

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