Reset() static private method

static private Reset ( ) : void
return void
Example #1
0
 public void End()
 {
     Program.GameEngine = null;
     Player.Reset();
     Card.Reset();
     CardIdentity.Reset();
     History.Reset();
     Selection.Clear();
 }
Example #2
0
        public void Reset()
        {
            TurnNumber   = 0;
            ActivePlayer = null;
            foreach (var p in Player.All)
            {
                foreach (var g in p.Groups)
                {
                    g.Reset();
                }
                foreach (var c in p.Counters)
                {
                    c.Reset();
                }
                foreach (var g in Definition.Player.GlobalVariables)
                {
                    p.GlobalVariables[g.Key] = g.Value.Value;
                }
            }
            foreach (var p in AllPhases)
            {
                p.Hold = false;
            }
            CurrentPhase = null;
            Table.Reset();
            Card.Reset();
            CardIdentity.Reset();
            Selection.Clear();

            if (Definition.GameBoards.ContainsKey(""))
            {
                GameBoard  = Definition.GameBoards[""];
                BoardImage = GameBoard.Source;
            }
            else
            {
                GameBoard  = null;
                BoardImage = null;
            }

            foreach (var g in Definition.GlobalVariables)
            {
                GlobalVariables[g.Key] = g.Value.Value;
            }

            DeckStats.Reset();

            //fix MAINWINDOW bug
            PlayWindow mainWin = WindowManager.PlayWindow;

            mainWin.RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, mainWin));
            EventProxy.OnGameStart_3_1_0_0();
            EventProxy.OnGameStart_3_1_0_1();
            EventProxy.OnGameStarted_3_1_0_2();
        }
Example #3
0
        public void End()
        {
            Program.GameMess.OnMessage -= GameMess_OnMessage;

            SaveHistory();
            ReplayWriter?.Dispose();
            ReplayEngine?.Dispose();
            _logStream?.Dispose();

            Program.GameEngine = null;
            Player.Reset();
            Card.Reset();
            CardIdentity.Reset();
            Selection.Clear();
        }
Example #4
0
        public void Reset()
        {
            TurnNumber   = 0;
            ActivePlayer = null;
            foreach (var p in Player.All)
            {
                foreach (var g in p.Groups)
                {
                    g.Reset();
                }
                foreach (var c in p.Counters)
                {
                    c.Reset();
                }
                foreach (var g in Definition.Player.GlobalVariables)
                {
                    p.GlobalVariables[g.Name] = g.DefaultValue;
                }
            }
            foreach (var p in AllPhases)
            {
                p.Hold = false;
            }
            CurrentPhase = null;
            Table.Reset();
            Card.Reset();
            CardIdentity.Reset();
            Selection.Clear();

            foreach (var g in Definition.GlobalVariables)
            {
                GlobalVariables[g.Name] = g.DefaultValue;
            }
            //fix MAINWINDOW bug
            PlayWindow mainWin = WindowManager.PlayWindow;

            mainWin.RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, mainWin));
            EventProxy.OnGameStart_3_1_0_0();
            EventProxy.OnGameStart_3_1_0_1();
            EventProxy.OnGameStarted_3_1_0_2();
        }
Example #5
0
        public void Reset(bool isSoft)
        {
            TurnNumber   = 0;
            ActivePlayer = null;
            foreach (var p in Player.All)
            {
                foreach (var g in p.Groups)
                {
                    g.Reset();
                }
                foreach (var c in p.Counters)
                {
                    c.Reset();
                }
                foreach (var g in Definition.Player.GlobalVariables)
                {
                    p.GlobalVariables[g.Key] = g.Value.Value;
                }
            }
            foreach (var p in AllPhases)
            {
                p.Hold = false;
            }
            CurrentPhase = null;
            Table.Reset();
            Card.Reset();
            CardIdentity.Reset();
            Selection.Clear();
            ResetTableView();

            foreach (var g in Definition.GlobalVariables)
            {
                GlobalVariables[g.Key] = g.Value.Value;
            }

            DeckStats.Reset();

            //fix MAINWINDOW bug
            PlayWindow mainWin = WindowManager.PlayWindow;

            mainWin.RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, mainWin));

            EventProxy.OnGameStart_3_1_0_0();
            EventProxy.OnGameStart_3_1_0_1();
            EventProxy.OnGameStarted_3_1_0_2();

            if (isSoft)
            {
                var currentDeck = new Deck()
                {
                    GameId   = LoadedCards.GameId,
                    IsShared = LoadedCards.IsShared,
                    Notes    = LoadedCards.Notes,
                    Sections = LoadedCards.Sections.ToList(),
                    Sleeve   = LoadedCards.Sleeve
                };
                LoadedCards.Sections = new ObservableCollection <ObservableSection>();
                LoadDeck(currentDeck, false);
            }
            else
            {
                LoadedCards.Sections = new ObservableCollection <ObservableSection>();
            }
        }