Beispiel #1
0
Battle* BattleManager::alloc_battle(room_t* room)
{
    Battle* battle = new Battle(room);

    if (battle == NULL) {
        KERROR_LOG(0, "out of memory");
        return NULL; 
    }

    battle_list_[battle_idx_] = battle;
    battle->set_battleid(battle_idx_);

    battle_idx_++;

    return battle;
}