Example #1
0
Tower* Tower::create(ValueMap model)
{
	Tower *ret = new Tower(model);
	if (ret && ret->init())
	{
		ret->autorelease();
		return ret;
	}
	else
	{
		CC_SAFE_DELETE(ret);
		return nullptr;
	}
}
Example #2
0
Tower *Tower::create(int id)
{
	Tower *ret = new Tower(id);
	if (ret && ret->init())
	{
	ret->autorelease();
	return ret;
	}
	else
	{
	CC_SAFE_DELETE(ret);
	return nullptr;
	}
}