예제 #1
0
Tower *Tower::create(TowerType type, ControllerType controller) {
    Tower *tower = new Tower();
    if (tower && tower->initWithType(type, controller)) {
        tower->autorelease();
        return tower;
    }
    CC_SAFE_DELETE(tower);
    return tower;
}
예제 #2
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;
	}
}
예제 #3
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;
	}
}