コード例 #1
0
ファイル: GamePage.xaml.cs プロジェクト: Pajdziu/Kostki
        public GamePage()
        {
            this._calculate = new Calculate();
            this._checker = new Checker();
            this._controlPanel = new ControlPanel();
            this._game = new Game(this._controlPanel);
            this._scoreCoords = new Point(this._controlPanel.GetTopJoker().X + 220, this._controlPanel.GetTopJoker().Y + 15);
            this._rectangles = new Rectangle[4, 4];

            InitializeComponent();

            this.ShowRectangle();
            this.CreateTextBlockForResult();
        }
コード例 #2
0
ファイル: GamePage.xaml.cs プロジェクト: Pajdziu/Kostki
        private void ResetGameState(object sender, EventArgs e)
        {
            this._controlPanel = new ControlPanel();
            this._game = new Game(_controlPanel);
            this._calculate = new Calculate();

            this.canvas.Children.Clear();

            this.ShowRectangle();
            this.CreateTextBlockForResult();

            CardImage[] cardImage = this._game.RandNewCards();
            Point point = new Point();

            for (int i = 0; i < cardImage.Count(); i++)
            {
                if (cardImage[i] == null)
                {
                    break;
                }

                ManipulationSettings(cardImage[i].image);
                canvas.Children.Add(cardImage[i].image);
                point = _controlPanel.GetRandCoordsForMarkRectangle(i + 1, 1);
                SettingCanvasTranslate(cardImage[i].image, point);
            }
        }