Beispiel #1
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();
        }
Beispiel #2
0
        public void Reset()
        {
            TurnNumber = 0;
            TurnPlayer = 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 varDef in Definition.Variables.Where(v => !v.Global && v.Reset))
                {
                    p.Variables[varDef.Name] = varDef.Default;
                }
                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 varDef in Definition.Variables.Where(v => v.Global && v.Reset))
            {
                Variables[varDef.Name] = varDef.Default;
            }
            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();
        }
Beispiel #3
0
        public void Reset()
        {
            TurnNumber = 0;
            TurnPlayer = null;
            foreach (Player p in Player.All)
            {
                foreach (Group g in p.Groups)
                {
                    g.Reset();
                }
                foreach (Counter c in p.Counters)
                {
                    c.Reset();
                }
                foreach (VariableDef varDef in Definition.Variables.Where(v => !v.Global && v.Reset))
                {
                    p.Variables[varDef.Name] = varDef.DefaultValue;
                }
                foreach (GlobalVariableDef g in Definition.PlayerDefinition.GlobalVariables)
                {
                    p.GlobalVariables[g.Name] = g.DefaultValue;
                }
            }
            Table.Reset();
            Card.Reset();
            CardIdentity.Reset();
            Selection.Clear();
            RandomRequests.Clear();
            foreach (VariableDef varDef in Definition.Variables.Where(v => v.Global && v.Reset))
            {
                Variables[varDef.Name] = varDef.DefaultValue;
            }
            foreach (GlobalVariableDef g in Definition.GlobalVariables)
            {
                GlobalVariables[g.Name] = g.DefaultValue;
            }
            //fix MAINWINDOW bug
            PlayWindow mainWin = Program.PlayWindow;

            mainWin.RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, mainWin));
        }
Beispiel #4
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>();
            }
        }