/// <summary> /// Bắt đầu game. Reset lại các biến. /// </summary> public static void CreateNewGame() { GameModelTLMN.ListPlayer.ForEach(p => { if (p.IsHasQuit) { GameModelTLMN.SetPlayer(p.slotServer, null); } }); ListJoinGameWhenPlaying.ForEach(p => GameModelTLMN.SetPlayer(p.slotServer, p)); ListJoinGameWhenPlaying.Clear(); GameModelTLMN.game.Listener.RegisterEventNewGame(); DealCardDone = false; DeckCount = 52; IndexInTurn = 0; IndexLastInTurn = 0; game.stolen = false; game.fullLaying = false; game.canRequestSort = true; game.listGiveCard.Clear(); game.sortList.Clear(); game.summaryGame.Clear(); game.meldList.Clear(); MiniState = EGameStateMini.discard; GameModelTLMN.UpdatePlayerSide(); if (IsQuitWhenEndGame) { game.OnQuitGame(false); } model.OnCreateNewGame(); }