// TButton.h: interface for the TButton class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TBUTTON_H__912680B6_6E70_11D6_8617_0000E87713C4__INCLUDED_)
#define AFX_TBUTTON_H__912680B6_6E70_11D6_8617_0000E87713C4__INCLUDED_

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

#include "TBaseObject.h"
#include "TElevator.h"

struct TFloorButton
{
   int up;
   int down;

   TFloorButton() { up = 0; down = 0; } 

   void reset() { up = 0; down = 0; }
};

class TButton : public TBaseObject 
{
   int number;
   int floorNumbers;
   TFloorButton pressedButton[MAX_FLOOR_NUMBER];
   
public:
	TButton();
	virtual ~TButton();

   void setNumber( int n ) { number = n; }
   void setFloorNumbers( int n ) { floorNumbers = n; }

	void draw( CDialog *wnd, CPaintDC *dc );

   void reset();

// интерфейс
   void pressButton( int floor, int up );
   void unpressButton( int floor, int up );
   int  checkButton( int floor, int up = 2 );

	int getLowerFloor( int up = 2 );
	int getUpperFloor( int up = 2 );
	int checkButtons( int up = 2 );
	int checkButtons( int lowFloor, int upFloor, int up = 2 );
};

#endif // !defined(AFX_TBUTTON_H__912680B6_6E70_11D6_8617_0000E87713C4__INCLUDED_)
