2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __PERFORMANCE_TOUCHES_TEST_H__
|
|
|
|
#define __PERFORMANCE_TOUCHES_TEST_H__
|
|
|
|
|
|
|
|
#include "PerformanceTest.h"
|
|
|
|
|
|
|
|
class TouchesMainScene : public PerformBasicLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TouchesMainScene(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0)
|
|
|
|
: PerformBasicLayer(bControlMenuVisible, nMaxCases, nCurCase)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void showCurrentTest();
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
protected:
|
2011-03-25 13:59:08 +08:00
|
|
|
CCLabelBMFont * m_plabel;
|
2012-04-19 14:35:52 +08:00
|
|
|
int numberOfTouchesB;
|
|
|
|
int numberOfTouchesM;
|
|
|
|
int numberOfTouchesE;
|
|
|
|
int numberOfTouchesC;
|
2012-06-08 13:55:28 +08:00
|
|
|
float elapsedTime;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
class TouchesPerformTest1 : public TouchesMainScene
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TouchesPerformTest1(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0)
|
|
|
|
: TouchesMainScene(bControlMenuVisible, nMaxCases, nCurCase)
|
|
|
|
{
|
2011-03-25 13:59:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual void registerWithTouchDispatcher();
|
|
|
|
|
|
|
|
virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
|
|
|
|
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
|
|
|
|
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
|
|
|
|
virtual void ccTouchCancelled(CCTouch* touch, CCEvent* event);
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TouchesPerformTest2 : public TouchesMainScene
|
|
|
|
{
|
2011-03-25 13:59:08 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TouchesPerformTest2(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0)
|
|
|
|
: TouchesMainScene(bControlMenuVisible, nMaxCases, nCurCase)
|
|
|
|
{
|
2011-03-25 13:59:08 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual void registerWithTouchDispatcher();
|
|
|
|
|
|
|
|
virtual void ccTouchesBegan(CCSet* touches, CCEvent* event);
|
|
|
|
virtual void ccTouchesMoved(CCSet* touches, CCEvent* event);
|
|
|
|
virtual void ccTouchesEnded(CCSet* touches, CCEvent* event);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void ccTouchesCancelled(CCSet* touches, CCEvent* event);
|
|
|
|
};
|
|
|
|
|
|
|
|
void runTouchesTest();
|
|
|
|
|
|
|
|
#endif
|