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; }
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; } }
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; } }