Beispiel #1
0
        private void DesenhaMovimento(Jogador jogador, Graphics g)
        {
            Point tempAnt = jogador.mPosAnt;
            Point tempAtu = jogador.mPosicao;


            List <Point> tCam = Cavalo.getCaminhoJogada(tempAnt, tempAtu);

            if (tCam != null)
            {
                foreach (Point point in tCam)
                {
                    Point tempx = new Point();
                    tempx.X = (point.X * xspan);
                    tempx.Y = (point.Y * yspan);
                    g.FillRectangle(Brushes.Blue, tempx.Y, tempx.X, yspan, xspan);
                }

                Point temp = new Point();
                temp.X = (tempAnt.X * xspan);
                temp.Y = (tempAnt.Y * yspan);
                g.FillRectangle(Brushes.Blue, temp.Y, temp.X, yspan, xspan);
                temp.X = (tempAtu.X * xspan);
                temp.Y = (tempAtu.Y * yspan);
                g.FillRectangle(Brushes.Blue, temp.Y, temp.X, yspan, xspan);
            }
        }
Beispiel #2
0
        public Jogador(int Largura, int Altura, Point posicao, bool totalSolution)
        {
            this.Largura = Largura;
            this.Altura  = Altura;

            mTab       = new Tabuleiro(Largura, Altura);
            mPeca      = new Cavalo();
            posInicial = posicao;

            mCaminho  = new Dictionary <Point, List <Point> >();
            Respostas = new List <List <Point> >();

            TotalSolution = totalSolution;
        }