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)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const;
|
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void showCurrentTest() override;
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void update(float dt) override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
protected:
|
2014-03-28 10:28:44 +08:00
|
|
|
Label * _plabel;
|
2013-12-19 05:52:10 +08:00
|
|
|
int numberOfTouchesB;
|
|
|
|
int numberOfTouchesM;
|
|
|
|
int numberOfTouchesE;
|
|
|
|
int numberOfTouchesC;
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-10-23 16:14:03 +08:00
|
|
|
bool onTouchBegan(Touch* touch, Event* event) ;
|
|
|
|
void onTouchMoved(Touch* touch, Event* event) ;
|
|
|
|
void onTouchEnded(Touch* touch, Event* event) ;
|
|
|
|
void onTouchCancelled(Touch* touch, Event* event) ;
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-10-23 11:27:24 +08:00
|
|
|
void onTouchesBegan(const std::vector<Touch*>& touches, Event* event) ;
|
|
|
|
void onTouchesMoved(const std::vector<Touch*>& touches, Event* event) ;
|
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) ;
|
|
|
|
void onTouchesCancelled(const std::vector<Touch*>& touches, Event* event) ;
|
2013-09-15 17:49:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TouchesPerformTest3 : public PerformBasicLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TouchesPerformTest3(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0)
|
|
|
|
: PerformBasicLayer(bControlMenuVisible, nMaxCases, nCurCase)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const;
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void showCurrentTest() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
void runTouchesTest();
|
|
|
|
|
|
|
|
#endif
|