2010-09-01 17:30:51 +08:00
|
|
|
#ifndef _TILEMAP_TEST_H_
|
|
|
|
#define _TILEMAP_TEST_H_
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-08 08:21:11 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(TileMapTests);
|
|
|
|
|
|
|
|
class TileDemo : public TestCase
|
2010-09-01 17:30:51 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
TileDemo();
|
|
|
|
virtual ~TileDemo();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onExit() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TileMapTest);
|
|
|
|
TileMapTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TileMapEditTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TileMapEditTest);
|
|
|
|
TileMapEditTest ();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2012-06-08 13:55:28 +08:00
|
|
|
void updateMap(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest);
|
|
|
|
TMXOrthoTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
2014-10-11 15:09:58 +08:00
|
|
|
class TMXStaggeredTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXStaggeredTest);
|
|
|
|
TMXStaggeredTest();
|
2014-10-11 15:09:58 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
};
|
|
|
|
|
2010-09-01 17:30:51 +08:00
|
|
|
class TMXOrthoTest2 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest2);
|
|
|
|
TMXOrthoTest2();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest3 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest3);
|
|
|
|
TMXOrthoTest3();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoTest4 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoTest4);
|
|
|
|
TMXOrthoTest4();
|
2012-06-08 13:55:28 +08:00
|
|
|
void removeSprite(float dt);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXReadWriteTest : public TileDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
unsigned int _gid;
|
|
|
|
unsigned int _gid2;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXReadWriteTest);
|
|
|
|
TMXReadWriteTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void removeSprite(Node* sender);
|
2012-06-08 13:55:28 +08:00
|
|
|
void updateCol(float dt);
|
|
|
|
void repaintWithGID(float dt);
|
|
|
|
void removeTiles(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXHexTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXHexTest);
|
|
|
|
TMXHexTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoTest);
|
|
|
|
TMXIsoTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest1 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoTest1);
|
|
|
|
TMXIsoTest1();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoTest2 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoTest2);
|
|
|
|
TMXIsoTest2();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXUncompressedTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXUncompressedTest);
|
|
|
|
TMXUncompressedTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilesetTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXTilesetTest);
|
|
|
|
TMXTilesetTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
2016-04-13 03:51:09 +08:00
|
|
|
class TMXCvsFormatTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXCvsFormatTest);
|
|
|
|
TMXCvsFormatTest();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
2010-09-01 17:30:51 +08:00
|
|
|
|
|
|
|
class TMXOrthoObjectsTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoObjectsTest);
|
|
|
|
TMXOrthoObjectsTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoObjectsTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoObjectsTest);
|
|
|
|
TMXIsoObjectsTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXResizeTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXResizeTest);
|
|
|
|
TMXResizeTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoZorder : public TileDemo
|
|
|
|
{
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoZorder);
|
|
|
|
TMXIsoZorder();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-07-15 12:04:48 +08:00
|
|
|
virtual void onExit()override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
~TMXIsoZorder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoZorder : public TileDemo
|
|
|
|
{
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoZorder);
|
|
|
|
TMXOrthoZorder();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual ~TMXOrthoZorder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoVertexZ : public TileDemo
|
|
|
|
{
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoVertexZ);
|
|
|
|
TMXIsoVertexZ();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
~TMXIsoVertexZ();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoVertexZ : public TileDemo
|
|
|
|
{
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _tamara;
|
2010-09-01 17:30:51 +08:00
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoVertexZ);
|
|
|
|
TMXOrthoVertexZ();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
~TMXOrthoVertexZ();
|
2012-06-08 13:55:28 +08:00
|
|
|
void repositionSprite(float dt);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXIsoMoveLayer : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXIsoMoveLayer);
|
|
|
|
TMXIsoMoveLayer();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoMoveLayer : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoMoveLayer);
|
|
|
|
TMXOrthoMoveLayer();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXTilePropertyTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXTilePropertyTest);
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXTilePropertyTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2010-09-01 17:30:51 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TMXOrthoFlipTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoFlipTest);
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoFlipTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXOrthoFlipRunTimeTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoFlipRunTimeTest);
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXOrthoFlipRunTimeTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void flipIt(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-12-30 11:33:41 +08:00
|
|
|
class TMXOrthoFromXMLTest : public TileDemo
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoFromXMLTest);
|
2012-03-26 16:46:23 +08:00
|
|
|
TMXOrthoFromXMLTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2013-12-30 12:01:22 +08:00
|
|
|
class TMXOrthoXMLFormatTest : public TileDemo
|
2013-12-30 11:33:41 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXOrthoXMLFormatTest);
|
2013-12-30 12:01:22 +08:00
|
|
|
TMXOrthoXMLFormatTest();
|
2013-12-30 11:33:41 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2011-02-23 16:47:25 +08:00
|
|
|
class TMXBug987 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXBug987);
|
2011-02-23 16:47:25 +08:00
|
|
|
TMXBug987();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2011-02-23 16:47:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TMXBug787 : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXBug787);
|
2011-02-23 16:47:25 +08:00
|
|
|
TMXBug787();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2011-02-23 16:47:25 +08:00
|
|
|
};
|
|
|
|
|
2011-07-12 14:21:29 +08:00
|
|
|
class TMXGIDObjectsTest : public TileDemo
|
2011-07-06 14:56:05 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TMXGIDObjectsTest);
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXGIDObjectsTest();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-09-11 15:39:56 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2011-07-06 14:56:05 +08:00
|
|
|
};
|
|
|
|
|
2016-07-02 06:51:00 +08:00
|
|
|
class TMXHexOddXTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXHexOddXTest);
|
|
|
|
TMXHexOddXTest();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXHexOddYTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXHexOddYTest);
|
|
|
|
TMXHexOddYTest();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXHexEvenXTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXHexEvenXTest);
|
|
|
|
TMXHexEvenXTest();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TMXHexEvenYTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXHexEvenYTest);
|
|
|
|
TMXHexEvenYTest();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2016-07-15 02:21:24 +08:00
|
|
|
class TMXHexAxisXTest : public TileDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TMXHexAxisXTest);
|
|
|
|
TMXHexAxisXTest();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2016-07-02 06:51:00 +08:00
|
|
|
|
2010-09-01 17:30:51 +08:00
|
|
|
#endif
|