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

#if !defined(AFX_TEFFCRITERIACOUNTER_H__20FAC09A_F11B_11D6_867D_0000E87713C4__INCLUDED_)
#define AFX_TEFFCRITERIACOUNTER_H__20FAC09A_F11B_11D6_867D_0000E87713C4__INCLUDED_

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

#include "TObject.h"

struct TEffFloorInfo
{
   int startFloorNumber;
};

struct TEffCriteriaParms
{
   int effCritWhereChange; // (1 - упал, 2 - не менялся, 3 - вырос)
   int oldECWhereChanged;
};

class TEffCriteriaCounter  
{
   TEffFloorInfo floorInfo[MAX_FLOOR_NUMBER][2];

   double effCriteria; // последний критерий эффективности
   double* effCriteriaHistory;

   void getOldAndNewKE( double* oldKE, double* newKE );

   int countWhenAdapt;

public:
	TEffCriteriaCounter();
	virtual ~TEffCriteriaCounter();

   double getEffCriteria() { return effCriteria; }

   void prestep();

   void pressButton( int floor, int up );
   void unpressButton( int floor, int up );

   bool isNeedToAdapt();
   void getECP( TEffCriteriaParms *ecp );

   void init();
   void reset();
};

#endif // !defined(AFX_TEFFCRITERIACOUNTER_H__20FAC09A_F11B_11D6_867D_0000E87713C4__INCLUDED_)
