int Game::init() { int i; Deck *deck; Deck *deck2; Deck *deckuser; deck = new Deck(); if (NULL == deck) { return ERROR_ALLOC; } deck->GetDeckAllCard(); this->decklist.push_back(deck); deck2 = new Deck(); if (NULL == deck2) { return ERROR_ALLOC; } *deck2 = *deck; this->decklist.push_back(deck2); for (i = 0; i< ePlayerNum * 2 + 1; i++) { deckuser = new Deck(); if (NULL == deckuser) { return ERROR_ALLOC; } this->decklist.push_back(deckuser); } this->eGameState = GAMESTATE_INIT; return ERROR_SUCCESS; }