Exemplo n.º 1
0
        internal static void StartGame()
        {
            // Reset the InvertedTable flags if they were set and they are not used
            if (!Program.GameSettings.UseTwoSidedTable)
            {
                foreach (Player player in Player.AllExceptGlobal)
                {
                    player.InvertedTable = false;
                }
            }

            // At start the global items belong to the player with the lowest id
            if (Player.GlobalPlayer != null)
            {
                Player host = Player.AllExceptGlobal.OrderBy(p => p.Id).First();
                foreach (Octgn.Play.Group group in Player.GlobalPlayer.Groups)
                {
                    group.Controller = host;
                }
            }
            if (Program.PlayWindow != null)
            {
                return;
            }
            Program.Client.Rpc.Start();
            Program.PlayWindow = new PlayWindow(Program.Game.IsLocal);
            Program.PlayWindow.Show();
            if (Program.PreGameLobbyWindow != null)
            {
                Program.PreGameLobbyWindow.Close();
            }
        }
Exemplo n.º 2
0
 private void Init(PlayWindow playWindow)
 {
     PlayWindow = playWindow;
     Strategy   = new StationaryStrategy();
     MaxSpeed   = DEFAULT_MAX_SPEED;
     Position   = Vector2.Zero;
 }
Exemplo n.º 3
0
        public PlayerCell(PlayWindow playWindow, Vector2 position)
            : base(playWindow, new KinectStrategy(), MAX_SPEED)
        {
            InitPlayerSprite();
            _spriteDict = new Dictionary<PlayerSprites, Sprite>();
            InitSprites();
            Position = position;
            _spriteDict[PlayerSprites.Cell].Position = Position;
            InitArms();

            _bodyRadius = 70;
            CreateSoftBody(30, _bodyRadius, 6f, 1, 0.5f, 3.0f);

            _bodyEffect = new BasicEffect(playWindow.GraphicsDevice);
            //_bodyEffect.EnableDefaultLighting();
            _bodyEffect.TextureEnabled = true;
            _bodyEffect.Texture = _cellTexture;
            _bodyEffect.World = Matrix.Identity;

            SetLeftArmRotation((float)Math.PI / 2, (float)Math.PI / 2);
            SetRightArmRotation(-(float)Math.PI / 2, -(float)Math.PI / 2);

            _leftHandGrabber = new VirusGrabber(VirusGrabber.Hand.LEFT, _spriteDict[PlayerSprites.LeftHand], PlayWindow.World, _centerBody);
            _rightHandGrabber = new VirusGrabber(VirusGrabber.Hand.RIGHT, _spriteDict[PlayerSprites.RightHand], PlayWindow.World, _centerBody);
        }
        private void button_Play_Click(object sender, RoutedEventArgs e)
        {
            PlayWindow playWindow = new PlayWindow();

            playWindow.Show();
            this.Close();
        }
Exemplo n.º 5
0
 void Start()
 {
     Player = GameObject.Find("First Person Controller").GetComponent <PlayerPower>();
     pause  = GameObject.Find("Pause").GetComponent <PauseMeny>();
     play   = GameObject.Find("Play").GetComponent <PlayWindow>();
     Talker = GameObject.Find("Fee");
 }
Exemplo n.º 6
0
        public override async void LoadLevel(Level level, List <AvailableElement> availableElements)
        {
            base.LoadLevel(level, availableElements);

            _playWindow = await CoreApplication.ViewManager.Show <PlayWindow, PlayWindowParams>(Window.PlayerWindow, new PlayWindowParams()
            {
                AvailableElements = availableElements
            });

            _playWindow.Play += OnPlayClick;

            foreach (var element in CurrentLevel.Elements.Where(x => !x.HelpElement))
            {
                SetupElement(element);
            }


            _playWindow.OnClickElement += data =>
            {
                if (_play)
                {
                    return;
                }
                _anyNewElementCreated = true;
                var newElement = CreateElement(data);
                newElement.StartDrag();
            };

            _tutorialCoroutine = StartCoroutine(CreateTutorialElements());
        }
Exemplo n.º 7
0
        //for console game start initialization
        public void Initialize(string ip)
        {
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock          = new System.Windows.Forms.Timer();
            PlayerClock.Tick    += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;


            if (ip == "0.0.0.0")
            {
                StartServer();
            }
            else
            {
                StartClient(ip);
            }

            PlayerClock.Start();
            playWindow.Show();

            Debug.NewMessage("play window show");


            Application.Run();
        }
 private void ButtonPlay_Click(object sender, RoutedEventArgs e)
 {
     if (TextBoxPath.Text.Length > 0)
     {
         PlayWindow.Source = new Uri(TextBoxPath.Text);
         PlayWindow.Play();
     }
 }
Exemplo n.º 9
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();
        }
Exemplo n.º 10
0
        public void Test1()
        {
            // Arrange
            PlayWindow win = new PlayWindow();

            // Act
            int result = win.testMeth();

            // Assert
            Assert.Equals(1, result);
        }
Exemplo n.º 11
0
        private void ReInitialize()
        {
            runColor               = FigureColor.WHITE;
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            inviteWindow           = new InviteWindow(pCollection);
            inviteWindow.OnChoice += new InviteWindow.OnChoiceEventHandler(InviteWindowMessageReceived);
            inviteWindow.Show();
        }
Exemplo n.º 12
0
        private void Start()
        {
            runColor               = FigureColor.WHITE;
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock          = new System.Windows.Forms.Timer();
            PlayerClock.Tick    += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;
            endGameLock          = false;
            PlayerClock.Start();
            playWindow.Show();
        }
Exemplo n.º 13
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();
        }
Exemplo n.º 14
0
 /// <summary>
 /// プレイウィンドウの開閉処理
 /// </summary>
 /// <param name="obj"></param>
 private void ShowCloseWindow(object obj)
 {
     if (this.window != null)
     {
         this.window.Close();
         this.window = null;
     }
     else
     {
         this.window             = new PlayWindow();
         this.window.DataContext = this.SelectedTab;
         this.window.Show();
     }
     this.WindowMaxCommand.RaiseCanExecuteChanged();
 }
Exemplo n.º 15
0
        public void Initialize()
        {
            matrix                 = new CoreMatrix();
            playWindow             = new PlayWindow(this, "Chess", new GuiMatrix(matrix));
            playWindow.FormClosed += new FormClosedEventHandler(PlayWindowClose);

            PlayerClock          = new System.Windows.Forms.Timer();
            PlayerClock.Tick    += new EventHandler(PlayerClock_Tick);
            PlayerClock.Interval = 1000;

            inviteWindow           = new InviteWindow(pCollection);
            inviteWindow.OnChoice += new InviteWindow.OnChoiceEventHandler(InviteWindowMessageReceived);
            inviteWindow.Show();
            Application.Run();
        }
Exemplo n.º 16
0
        public Wall(Vertices vertices, WallType type, PlayWindow playWindow)
        {
            _playWindow = playWindow;

            _thickness = 100.0f;

            Vertices wallVertices = SimplifyTools.CollinearSimplify(vertices);
            _body = BodyFactory.CreateLoopShape(_playWindow.World, VerticesToSimUnits(wallVertices));
            _body.CollisionCategories = Category.All;
            _body.CollidesWith = Category.All;

            _basicEffect = new BasicEffect(_playWindow.GraphicsDevice);
            _basicEffect.TextureEnabled = true;
            _basicEffect.Texture = _wallTexture;

            InitDrawVertices(wallVertices, type);
        }
Exemplo n.º 17
0
        public void GroupLookAt(int id, int value, bool isTop)
        {
            var g = (Pile)Group.Find(id);

            if (g.Controller != Player.LocalPlayer)
            {
                Program.GameMess.Warning(String.Format("{0} can't look at {1} because they don't control it.", Player.LocalPlayer.Name, g.Name));
            }
            PlayWindow playWindow = WindowManager.PlayWindow;

            if (playWindow == null)
            {
                return;
            }
            Octgn.Controls.ChildWindowManager manager = playWindow.wndManager;
            if (value > 0)
            {
                if (isTop)
                {
                    QueueAction(() => manager.Show(new GroupWindow(@g, PilePosition.Top, value)));
                }
                else
                {
                    QueueAction(() => manager.Show(new GroupWindow(@g, PilePosition.Bottom, value)));
                }
            }

            else if (value == 0)
            {
                int count;
                if (isTop)
                {
                    count = QueueAction <int>(() => Dialog.InputPositiveInt("View top cards", "How many cards do you want to see?", 1));
                    QueueAction(() => manager.Show(new GroupWindow(@g, PilePosition.Top, count)));
                }
                else
                {
                    count = QueueAction <int>(() => Dialog.InputPositiveInt("View bottom cards", "How many cards do you want to see?", 1));
                    QueueAction(() => manager.Show(new GroupWindow(@g, PilePosition.Bottom, count)));
                }
            }
            else
            {
                QueueAction(() => manager.Show(new GroupWindow(@g, PilePosition.All, 0)));
            }
        }
Exemplo n.º 18
0
        public Wall(Vertices vertices, WallType type, PlayWindow playWindow)
        {
            _playWindow = playWindow;

            _thickness = 100.0f;

            Vertices wallVertices = SimplifyTools.CollinearSimplify(vertices);

            _body = BodyFactory.CreateLoopShape(_playWindow.World, VerticesToSimUnits(wallVertices));
            _body.CollisionCategories = Category.All;
            _body.CollidesWith        = Category.All;

            _basicEffect = new BasicEffect(_playWindow.GraphicsDevice);
            _basicEffect.TextureEnabled = true;
            _basicEffect.Texture        = _wallTexture;

            InitDrawVertices(wallVertices, type);
        }
Exemplo n.º 19
0
        public override void Update(GameTime gameTime)
        {
            PlayWindow playWindow = Owner.PlayWindow;
            timer += gameTime.ElapsedGameTime.TotalSeconds;
            if (_target != null)
                _targetDistance = (Owner.Position - _target.Position).Length();
            else
                _targetDistance = float.MaxValue;

            if (timer > 5 && _targetDistance > 2)
            {
                if (Owner.PlayWindow.GoodCellList.Count > 0)
                    FindTarget(Owner.PlayWindow.World);
                else
                    _target = null;
                timer = 0;
            }
        }
Exemplo n.º 20
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            pw = new PlayWindow();
            pw.Show();
            pw.ConnectTimeLine(tl);
            pw.ConnectPreview(preview);

            tl.FrameRate = FrameRate._60PFS;

            tl.AddTrack(SourceType.Sound, 1);
            tl.AddTrack(SourceType.Video, 1);
            tl.AddTrack(SourceType.Video, 2);
            tl.AddTrack(SourceType.Video, 3);
            tl.AddTrack(SourceType.Light, 1);
            tl.AddTrack(SourceType.Light, 2);
            tl.AddTrack(SourceType.Light, 3);
            tl.AddTrack(SourceType.Light, 4);
            tl.AddTrack(SourceType.Image, 1);
        }
Exemplo n.º 21
0
        private void FadeOut(GameTime gameTime)
        {
            _fadeStepTimer += gameTime.ElapsedGameTime.TotalSeconds;
            _fadeOutTimer  += gameTime.ElapsedGameTime.TotalSeconds;

            if (_fadeOutTimer > FADE_OUT_TIME)
            {
                PlayWindow.RemoveVirus(this);
            }
            while (_fadeStepTimer > FADE_STEP_TIME)
            {
                Color color = Sprite.Color;
                color.A        -= 1;
                color.R        -= 1;
                color.G        -= 1;
                color.B        -= 1;
                Sprite.Color    = color;
                _fadeStepTimer -= FADE_STEP_TIME;
            }
        }
Exemplo n.º 22
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));
        }
Exemplo n.º 23
0
        public void ExplodeByVirus()
        {
            float radius = Body.FixtureList.First().Shape.Radius;

            for (int i = 0; i < 1 + _virusList.Count; i++)
            {
                Vector2 position;
                position.X = this.Position.X - radius / 2 + (float)Shared.Random.NextDouble() * radius;
                position.Y = this.Position.Y - radius / 2 + (float)Shared.Random.NextDouble() * radius;

                Virus newVirus = new Virus(PlayWindow, position);
                PlayWindow.RegisterVirus(newVirus);

                ApplyExplodeForce(newVirus);
            }

            foreach (var item in _virusList)
            {
                PlayWindow.RemoveVirus(item);
            }
            PlayWindow.RemoveGoodCell(this);
        }
Exemplo n.º 24
0
        public Background(string file, PlayWindow playWindow)
        {
            _scaleFactor = 500;
            _playWindow  = playWindow;

            _basicEffect = new BasicEffect(_playWindow.GraphicsDevice);
            _basicEffect.TextureEnabled = true;
            _basicEffect.Texture        = Game1.contentManager.Load <Texture2D>(file);

            _scaleFactor = 1000;


            vertices = new VertexPositionTexture[4];
            vertices[0].Position.X          = -10000;
            vertices[0].Position.Y          = -10000;
            vertices[0].Position.Z          = 0;
            vertices[0].TextureCoordinate.X = vertices[0].Position.X / _scaleFactor;
            vertices[0].TextureCoordinate.Y = vertices[0].Position.Y / _scaleFactor;

            vertices[1].Position.X          = 10000;
            vertices[1].Position.Y          = -10000;
            vertices[1].Position.Z          = 0;
            vertices[1].TextureCoordinate.X = vertices[1].Position.X / _scaleFactor;
            vertices[1].TextureCoordinate.Y = vertices[1].Position.Y / _scaleFactor;

            vertices[2].Position.X          = -10000;
            vertices[2].Position.Y          = 10000;
            vertices[2].Position.Z          = 0;
            vertices[2].TextureCoordinate.X = vertices[2].Position.X / _scaleFactor;
            vertices[2].TextureCoordinate.Y = vertices[2].Position.Y / _scaleFactor;

            vertices[3].Position.X          = 10000;
            vertices[3].Position.Y          = 10000;
            vertices[3].Position.Z          = 0;
            vertices[3].TextureCoordinate.X = vertices[3].Position.X / _scaleFactor;
            vertices[3].TextureCoordinate.Y = vertices[3].Position.Y / _scaleFactor;
        }
Exemplo n.º 25
0
        public Background(string file, PlayWindow playWindow)
        {
            _scaleFactor = 500;
            _playWindow = playWindow;

            _basicEffect = new BasicEffect(_playWindow.GraphicsDevice);
            _basicEffect.TextureEnabled = true;
            _basicEffect.Texture = Game1.contentManager.Load<Texture2D>(file);

            _scaleFactor = 1000;

            vertices = new VertexPositionTexture[4];
            vertices[0].Position.X = -10000;
            vertices[0].Position.Y = -10000;
            vertices[0].Position.Z = 0;
            vertices[0].TextureCoordinate.X = vertices[0].Position.X / _scaleFactor;
            vertices[0].TextureCoordinate.Y = vertices[0].Position.Y / _scaleFactor;

            vertices[1].Position.X = 10000;
            vertices[1].Position.Y = -10000;
            vertices[1].Position.Z = 0;
            vertices[1].TextureCoordinate.X = vertices[1].Position.X / _scaleFactor;
            vertices[1].TextureCoordinate.Y = vertices[1].Position.Y / _scaleFactor;

            vertices[2].Position.X = -10000;
            vertices[2].Position.Y = 10000;
            vertices[2].Position.Z = 0;
            vertices[2].TextureCoordinate.X = vertices[2].Position.X / _scaleFactor;
            vertices[2].TextureCoordinate.Y = vertices[2].Position.Y / _scaleFactor;

            vertices[3].Position.X = 10000;
            vertices[3].Position.Y = 10000;
            vertices[3].Position.Z = 0;
            vertices[3].TextureCoordinate.X = vertices[3].Position.X / _scaleFactor;
            vertices[3].TextureCoordinate.Y = vertices[3].Position.Y / _scaleFactor;
        }
Exemplo n.º 26
0
        public PlayerCell(PlayWindow playWindow, Vector2 position) : base(playWindow, new KinectStrategy(), MAX_SPEED)
        {
            InitPlayerSprite();
            _spriteDict = new Dictionary <PlayerSprites, Sprite>();
            InitSprites();
            Position = position;
            _spriteDict[PlayerSprites.Cell].Position = Position;
            InitArms();

            _bodyRadius = 70;
            CreateSoftBody(30, _bodyRadius, 6f, 1, 0.5f, 3.0f);

            _bodyEffect = new BasicEffect(playWindow.GraphicsDevice);
            //_bodyEffect.EnableDefaultLighting();
            _bodyEffect.TextureEnabled = true;
            _bodyEffect.Texture        = _cellTexture;
            _bodyEffect.World          = Matrix.Identity;

            SetLeftArmRotation((float)Math.PI / 2, (float)Math.PI / 2);
            SetRightArmRotation(-(float)Math.PI / 2, -(float)Math.PI / 2);

            _leftHandGrabber  = new VirusGrabber(VirusGrabber.Hand.LEFT, _spriteDict[PlayerSprites.LeftHand], PlayWindow.World, _centerBody);
            _rightHandGrabber = new VirusGrabber(VirusGrabber.Hand.RIGHT, _spriteDict[PlayerSprites.RightHand], PlayWindow.World, _centerBody);
        }
Exemplo n.º 27
0
 public LevelParser(PlayWindow playWindow)
 {
     PlayWindow = playWindow;
 }
Exemplo n.º 28
0
 public GoodCell(PlayWindow playWindow, Vector2 position)
     : base(playWindow, new StationaryStrategy())
 {
     Position = position;
     Init();
 }
Exemplo n.º 29
0
 public GoodCell(PlayWindow playWindow)
     : base(playWindow, new StationaryStrategy())
 {
     Init();
 }
Exemplo n.º 30
0
 private void ButtonStop_Click(object sender, RoutedEventArgs e)
 {
     PlayWindow.Stop();
 }
Exemplo n.º 31
0
 public ActiveGameObject(PlayWindow playWindow, Strategy strategy)
 {
     Init(playWindow);
     Strategy = strategy;
 }
Exemplo n.º 32
0
 public Virus(PlayWindow playWindow, Vector2 position)
     : base(playWindow, new VirusStrategy())
 {
     Position = position;
     init();
 }
Exemplo n.º 33
0
 public Virus(PlayWindow playWindow)
     : base(playWindow, new VirusStrategy())
 {
     init();
 }
Exemplo n.º 34
0
 public GoodCell(PlayWindow playWindow) : base(playWindow, new StationaryStrategy())
 {
     Init();
 }
Exemplo n.º 35
0
 public GoodCell(PlayWindow playWindow, Vector2 position)
     : base(playWindow, new StationaryStrategy())
 {
     Position = position;
     Init();
 }
Exemplo n.º 36
0
 private void Init(PlayWindow playWindow)
 {
     PlayWindow = playWindow;
     Strategy = new StationaryStrategy();
     MaxSpeed = DEFAULT_MAX_SPEED;
     Position = Vector2.Zero;
 }
Exemplo n.º 37
0
 public ActiveGameObject(PlayWindow playWindow, Strategy strategy, double maxSpeed)
 {
     Init(playWindow);
     Strategy = strategy;
     MaxSpeed = maxSpeed * maxSpeed;
 }
Exemplo n.º 38
0
 public LevelParser(PlayWindow playWindow)
 {
     PlayWindow = playWindow;
 }
Exemplo n.º 39
0
 public ActiveGameObject(PlayWindow playWindow)
 {
     Init(playWindow);
 }
Exemplo n.º 40
0
 public ActiveGameObject(PlayWindow playWindow)
 {
     Init(playWindow);
 }
Exemplo n.º 41
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>();
            }
        }
Exemplo n.º 42
0
 public ActiveGameObject(PlayWindow playWindow, Strategy strategy)
 {
     Init(playWindow);
     Strategy = strategy;
 }