public void Reset(bool resetStats = true) { Logger.WriteLine(">>>>>>>>>>> Reset <<<<<<<<<<<", "Game"); ReplayMaker.Reset(); PlayerDrawn.Clear(); PlayerDrawnIdsTotal.Clear(); Entities.Clear(); PlayerId = -1; OpponentId = -1; SavedReplay = false; PlayerHandCount = 0; PlayerFatigueCount = 0; OpponentSecretCount = 0; OpponentCards.Clear(); OpponentHandCount = 0; OpponentFatigueCount = 0; OpponentDeckCount = 30; PlayerDeckSize = 30; SecondToLastUsedId = null; OpponentHandAge = new int[MaxHandSize]; OpponentHandMarks = new CardMark[MaxHandSize]; OpponentStolenCardsInformation = new Card[MaxHandSize]; OpponentSecrets.ClearSecrets(); NoMatchingDeck = false; _playingAs = null; for (var i = 0; i < MaxHandSize; i++) { OpponentHandAge[i] = -1; OpponentHandMarks[i] = CardMark.None; } // Assuming opponent has coin, corrected if we draw it OpponentHandMarks[DefaultCoinPosition] = CardMark.Coin; OpponentHandAge[DefaultCoinPosition] = 0; OpponentHasCoin = true; SetAsideCards.Clear(); OpponentReturnedToDeck.Clear(); //if(CurrentGameMode == GameMode.Ranked) //otherwise switching from playing ranked to casual causes problems // CurrentGameMode = GameMode.Casual; if (!IsInMenu && resetStats) { if (CurrentGameMode != GameMode.Spectator) { CurrentGameMode = GameMode.None; } CurrentGameStats = new GameStats(GameResult.None, PlayingAgainst, PlayingAs) { PlayerName = PlayerName, OpponentName = OpponentName, Region = CurrentRegion }; } hsLogLines = new List <string>(); }
public void Reset(bool resetStats = true) { Log.Info("-------- Reset ---------"); ReplayMaker.Reset(); Player.Reset(); Opponent.Reset(); Entities.Clear(); SavedReplay = false; OpponentSecretCount = 0; OpponentSecrets.ClearSecrets(); if (!IsInMenu && resetStats) { if (CurrentGameMode == GameMode.Ranked) { Log.Info("Resetting gamemode to casual"); CurrentGameMode = GameMode.Casual; } CurrentGameStats = new GameStats(GameResult.None, "", "") { PlayerName = "", OpponentName = "", Region = CurrentRegion }; _gameModeDetectionComplete = false; } PowerLog.Clear(); if (Core.Game != null && Core.Overlay != null) { Core.UpdatePlayerCards(true); Core.UpdateOpponentCards(true); } }
public void Reset(bool resetStats = true) { Log.Info("-------- Reset ---------"); ReplayMaker.Reset(); Player.Reset(); Opponent.Reset(); Entities.Clear(); SavedReplay = false; OpponentSecretCount = 0; OpponentSecrets.ClearSecrets(); _spectator = null; _currentGameMode = GameMode.None; _currentFormat = null; if (!IsInMenu && resetStats) { CurrentGameStats = new GameStats(GameResult.None, "", "") { PlayerName = "", OpponentName = "", Region = CurrentRegion } } ; PowerLog.Clear(); if (Core.Game != null && Core.Overlay != null) { Core.UpdatePlayerCards(true); Core.UpdateOpponentCards(true); } }
public void Reset(bool resetStats = true) { Logger.WriteLine("-------- Reset ---------", "Game"); ReplayMaker.Reset(); Player.Reset(); Opponent.Reset(); Entities.Clear(); SavedReplay = false; OpponentSecretCount = 0; OpponentSecrets.ClearSecrets(); NoMatchingDeck = false; if (!IsInMenu && resetStats) { if (CurrentGameMode != GameMode.Spectator) { CurrentGameMode = GameMode.None; } CurrentGameStats = new GameStats(GameResult.None, "", "") { PlayerName = "", OpponentName = "", Region = CurrentRegion }; } _hsLogLines = new List <string>(); if (Helper.MainWindow.Overlay != null) { Helper.UpdatePlayerCards(); Helper.UpdateOpponentCards(); } }
public void Reset(bool resetStats = true) { Logger.WriteLine("-------- Reset ---------", "Game"); ReplayMaker.Reset(); Player.Reset(); Opponent.Reset(); Entities.Clear(); SavedReplay = false; OpponentSecretCount = 0; OpponentSecrets.ClearSecrets(); NoMatchingDeck = false; if (!IsInMenu && resetStats) { if (CurrentGameMode == GameMode.Ranked) { Logger.WriteLine("Resetting gamemode to casual", "Game"); CurrentGameMode = GameMode.Casual; } CurrentGameStats = new GameStats(GameResult.None, "", "") { PlayerName = "", OpponentName = "", Region = CurrentRegion }; _gameModeDetectionComplete = false; } _hsLogLines = new List <string>(); if (Core.Game != null && Core.Overlay != null) { Helper.UpdatePlayerCards(); Helper.UpdateOpponentCards(); } }
public static void Reset(bool resetStats = true) { Logger.WriteLine(">>>>>>>>>>> Reset <<<<<<<<<<<"); ReplayMaker.Reset(); PlayerDrawn.Clear(); Entities.Clear(); PlayerId = -1; OpponentId = -1; SavedReplay = false; PlayerHandCount = 0; OpponentSecretCount = 0; OpponentCards.Clear(); OpponentHandCount = 0; OpponentDeckCount = 30; SecondToLastUsedId = null; OpponentHandAge = new int[MaxHandSize]; OpponentHandMarks = new CardMark[MaxHandSize]; OpponentStolenCardsInformation = new Card[MaxHandSize]; OpponentSecrets.ClearSecrets(); for (var i = 0; i < MaxHandSize; i++) { OpponentHandAge[i] = -1; OpponentHandMarks[i] = CardMark.None; } // Assuming opponent has coin, corrected if we draw it OpponentHandMarks[DefaultCoinPosition] = CardMark.Coin; OpponentHandAge[DefaultCoinPosition] = 0; OpponentHasCoin = true; SetAsideCards.Clear(); OpponentReturnedToDeck.Clear(); if (!IsInMenu && resetStats) { CurrentGameStats = new GameStats(GameResult.None, PlayingAgainst, PlayingAs) { PlayerName = PlayerName, OpponentName = OpponentName }; } hsLogLines = new List <string>(); }
public void Reset(bool resetStats = true) { Log.Info("-------- Reset ---------"); ReplayMaker.Reset(); Player.Reset(); Opponent.Reset(); if (!_matchInfoCacheInvalid && MatchInfo?.LocalPlayer != null && MatchInfo.OpposingPlayer != null) { Player.Name = MatchInfo.LocalPlayer.Name; Opponent.Name = MatchInfo.OpposingPlayer.Name; Player.Id = MatchInfo.LocalPlayer.Id; Opponent.Id = MatchInfo.OpposingPlayer.Id; } Entities.Clear(); SavedReplay = false; OpponentSecretCount = 0; OpponentSecrets.ClearSecrets(); _spectator = null; _currentGameMode = GameMode.None; _currentGameType = GameType.GT_UNKNOWN; _currentFormat = FormatType.FT_UNKNOWN; if (!IsInMenu && resetStats) { CurrentGameStats = new GameStats(GameResult.None, "", "") { PlayerName = "", OpponentName = "", Region = CurrentRegion } } ; PowerLog.Clear(); if (Core.Game != null && Core.Overlay != null) { Core.UpdatePlayerCards(true); Core.UpdateOpponentCards(true); } }