hayateasdf's blog

Unity,C#, javascript,C++,python,batなど

cocos-2dxでtest用に作ったインターフェイスとマクロ


namespace tt
{
	/*
	* test interface
	*/
	class ITest
	{
	public:
		virtual ~ITest(){}
		virtual void test(cocos2d::Node* parent) = 0;
	};

#define CREATE_TEST_CLASS(CLASS_NAME) \
	class CLASS_NAME : public cocos2d::Node, public ITest { \
	public: \
	void test(cocos2d::Node* parent) override; \
	CREATE_FUNC(CLASS_NAME); };

	CREATE_TEST_CLASS(HttpTest);
	CREATE_TEST_CLASS(JsonTest);
	CREATE_TEST_CLASS(JsonRequestTest);
};