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