GameObjectModel* GameObjectModel::Create(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string const& dataPath) { GameObjectModel* mdl = new GameObjectModel(); if (!mdl->initialize(std::move(modelOwner), dataPath)) { delete mdl; return NULL; } return mdl; }
GameObjectModel* GameObjectModel::Create(const GameObject& go) { const GameObjectDisplayInfoEntry* info = sGameObjectDisplayInfoStore.LookupEntry(go.GetDisplayId()); if (!info) return NULL; GameObjectModel* mdl = new GameObjectModel(); if (!mdl->initialize(go, *info)) { delete mdl; return NULL; } return mdl; }
GameObjectModel* GameObjectModel::construct(const GameObject* const pGo) { const GameObjectDisplayInfoEntry* info = sGameObjectDisplayInfoStore.LookupEntry(pGo->GetDisplayId()); if (!info) { return NULL; } GameObjectModel* mdl = new GameObjectModel(); if (!mdl->initialize(pGo, info)) { delete mdl; return NULL; } return mdl; }