www.pudn.com > Ä£ÄâLIFT.rar > MyLift.cpp


// MyLift.cpp: implementation of the MyLift class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "lift.h" 
#include "MyLift.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
MyLift::MyLift() 
{ 
	PresentFloor=1; 
	for(int i=0;i<8;i++) 
	{ 
		state[i].down=false; 
		state[i].up=false; 
		stop[i]=0; 
	} 
} 
 
MyLift::~MyLift() 
{ 
 
} 
 
///////////////////////////////////////////////////////////////////////////////// 
//mkstate:to record the state of lift 
 
void MyLift::mkState(int Floor,bool UporDown) 
{ 
	if(UporDown==true) 
	{ 
		state[Floor-1].up=true; 
	} 
	else 
	{ 
		state[Floor-1].down=true; 
	} 
}