2014-02-10 11:42:15 +08:00
|
|
|
#ifndef __PERFORMANCE_SCENARIO_TEST_H__
|
|
|
|
#define __PERFORMANCE_SCENARIO_TEST_H__
|
|
|
|
|
|
|
|
#include "PerformanceTest.h"
|
|
|
|
|
|
|
|
class ScenarioMenuLayer : public PerformBasicLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScenarioMenuLayer(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0)
|
|
|
|
:PerformBasicLayer(bControlMenuVisible, nMaxCases, nCurCase)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void showCurrentTest();
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-10 11:42:15 +08:00
|
|
|
virtual std::string title() const;
|
|
|
|
virtual std::string subtitle() const;
|
|
|
|
virtual void performTests() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ScenarioTest : public ScenarioMenuLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScenarioTest(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0)
|
|
|
|
:ScenarioMenuLayer(bControlMenuVisible, nMaxCases, nCurCase)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual void performTests();
|
|
|
|
|
2014-02-12 16:14:04 +08:00
|
|
|
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
|
|
|
|
|
2014-02-10 11:42:15 +08:00
|
|
|
static Scene* scene();
|
|
|
|
|
|
|
|
private:
|
2014-02-12 16:14:04 +08:00
|
|
|
void addNewSprites(int num);
|
2014-02-10 11:42:15 +08:00
|
|
|
void removeSprites();
|
|
|
|
|
|
|
|
void addParticles();
|
|
|
|
void removeParticles();
|
|
|
|
|
2014-02-12 16:14:04 +08:00
|
|
|
void addParticleSystem(int num);
|
|
|
|
void removeParticleSystem();
|
|
|
|
|
2014-02-10 11:42:15 +08:00
|
|
|
private:
|
2014-02-12 16:14:04 +08:00
|
|
|
static int _initParticleNum;
|
|
|
|
static int _parStepNum;
|
|
|
|
static int _initSpriteNum;
|
|
|
|
static int _spriteStepNum;
|
|
|
|
static int _initParsysNum;
|
|
|
|
static int _parsysStepNum;
|
|
|
|
|
|
|
|
TMXTiledMap* _map1;
|
|
|
|
TMXTiledMap* _map2;
|
|
|
|
|
2014-02-10 11:42:15 +08:00
|
|
|
MenuItemToggle* _itemToggle;
|
|
|
|
Vector<Sprite*> _spriteArray;
|
2014-02-12 16:14:04 +08:00
|
|
|
Vector<ParticleSystemQuad*> _parsysArray;
|
2014-03-26 23:33:58 +08:00
|
|
|
Label* _spriteLabel;
|
|
|
|
Label* _particleLabel;
|
|
|
|
Label* _parsysLabel;
|
2014-02-10 11:42:15 +08:00
|
|
|
int _particleNumber;
|
|
|
|
};
|
|
|
|
|
|
|
|
void runScenarioTest();
|
|
|
|
|
|
|
|
#endif
|