예제 #1
0
파일: Square.cs 프로젝트: jumpt57/dames
        public Square(int column, int row, Board Board)
        {
            this.Rec = new Rectangle();
            this.Rec.Height = this.Rec.Width = 75;
            this.Rec.HorizontalAlignment = HorizontalAlignment.Center;
            this.Rec.VerticalAlignment = VerticalAlignment.Center;
            this.Rec.Stroke = Brushes.Black;
            DefineColor();

            this.Rec.MouseLeftButtonDown += OnMouseLeftClick;

            this.Column = column;
            this.Row = row;
            this.Board = Board;
            this.Hovered = false;
            this.PossibleManger = false;
        }
예제 #2
0
파일: Human.cs 프로젝트: jumpt57/dames
        public override bool PossibleMovements(Board board, Square Square)
        {
            bool possible = false;
            bool reset = false;
            bool left = false;
            for (int i = Square.GetColumn() - 1; i <= Square.GetColumn() + 1; i++)
            {
                var SquareTMP = board.SquareAt(i, Square.GetRow() - 1);

                if (SquareTMP != null && !SquareTMP.GetColored()) continue;
                left = !left;

                if (!reset)
                {
                    board.ResetSelectedSquares();
                    reset = true;
                }

                if (SquareTMP.GetPon() == null)
                {
                    SquareTMP.IsHovered();
                    possible = true;
                }
                else if (SquareTMP.GetPon() != null && SquareTMP.GetPon().GetPlayer().GetIa())
                {
                    Square SquareTMPPlus1 = null;
                    if (left)
                    {
                        SquareTMPPlus1 = board.SquareAt(i - 1, Square.GetRow() - 2);
                    }
                    else
                    {
                        SquareTMPPlus1 = board.SquareAt(i + 1, Square.GetRow() + 2);
                    }

                    if (SquareTMPPlus1 != null && SquareTMPPlus1.GetPon() == null)
                    {
                        SquareTMP.IsPossibleManger();
                        possible = true;
                    }
                }

            }
            return possible;
        }
예제 #3
0
파일: Player.cs 프로젝트: jumpt57/dames
 public abstract bool PossibleMovements(Board board, Square Square);
예제 #4
0
파일: Ia.cs 프로젝트: jumpt57/dames
 public override bool PossibleMovements(Board board, Square Square)
 {
     return true;
 }