private void ButGame_Click(object sender, EventArgs e) { Button but = sender as Button; int id = (int)but.Tag; GameSaveData data = CaroService.Storage.GameList.SingleOrDefault(x => x.id == id); if (data != null) { CaroService.Storage.CurrentIndex = id; SettingConfig.InitializeGameSaveSetting(data); CaroService.Player.PlayerName1 = data.PlayerName1; CaroService.Player.PlayerName2 = data.PlayerName2; CaroService.Player.Turn = data.Turn; CaroService.Action.ResetAction(); CaroService.Board.InitCaroBoard(); CaroService.Board.DrawCaroBoard(); CaroService.Winner.LoadSaveGame(data.Turn, data.CaroBoard); if (isSetting) { Control parent = this.Parent; parent.Hide(); } else { routes.Routing(Constants.MAIN); } } else { MessageBox.Show("Not Found Your Game", "Thông Báo", MessageBoxButtons.OK); } }