void LevelScene::placeBGO(LevelBGO bgoData)
{
    if(!ConfigManager::lvl_bgo_indexes.contains(bgoData.id))
        return;

    LVL_Bgo * bgo;
    bgo = new LVL_Bgo();
    bgo->data = bgoData;
    bgo->init();
    bgos.push_back(bgo);
}
LVL_Bgo* LevelScene::spawnBGO(LevelBGO bgoData)
{
    if(!ConfigManager::lvl_bgo_indexes.contains(bgoData.id))
        return NULL;
    bgoData.array_id= ++data.blocks_array_id;
    LVL_Bgo * bgo;
    bgo = new LVL_Bgo();
    bgo->data = bgoData;
    bgo->init();
    bgos.push_back(bgo);
    return bgo;
}
void LevelScene::placeBGO(LevelBGO& bgoData)
{
    if(bgoData.id <= 0) return;

    if(!ConfigManager::lvl_bgo_indexes.contains(bgoData.id))
        return;

    LVL_Bgo *bgo;
    bgo = new LVL_Bgo(this);

    if(!bgo) throw("Out of memory [new LVL_Bgo place]");

    bgo->data = bgoData;
    bgo->init();
    m_itemsBgo.push_back(bgo);
}
LVL_Bgo *LevelScene::spawnBGO(const LevelBGO &bgoData)
{
    if(bgoData.id <= 0) return NULL;

    if(!ConfigManager::lvl_bgo_indexes.contains(bgoData.id))
        return NULL;

    LVL_Bgo *bgo;
    bgo = new LVL_Bgo(this);
    SDL_assert(bgo);
    if(!bgo)
        throw("Out of memory [new LVL_Bgo] spawn");

    bgo->data = bgoData;
    bgo->data.meta.array_id = ++m_data.blocks_array_id;
    bgo->init();
    m_itemsBgo.push_back(bgo);
    return bgo;
}