示例#1
0
        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
        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);
            }
        }
示例#3
0
        /// <summary>
        /// Czyszczenie Pamięci.
        /// </summary>
        private void ClearMemory()
        {
            ControlPanel controlClear = new ControlPanel();
            Game gameClear = new Game(controlClear);

            CardImage[] cardImage = gameClear.RandNewCards();

            AppMemory appMemory = new AppMemory();
            appMemory.SaveGameState(gameClear.GetGameBoard(), 0);
        }