Example #1
0
        public override List <KeyValuePair <int, int> > GetAvaliableMovements(int boardSize)
        {
            var result = new List <KeyValuePair <int, int> >();

            for (int i = 0; i < boardSize; i++)
            {
                SimpleChess.AddIfPosible(result, boardSize, i, this.Y);
                SimpleChess.AddIfPosible(result, boardSize, this.X, i);
            }
            return(result);
        }
Example #2
0
        public override List <KeyValuePair <int, int> > GetAvaliableMovements(int boardSize)
        {
            var result = new List <KeyValuePair <int, int> >();

            SimpleChess.AddIfPosible(result, boardSize, this.X + 2, this.Y + 1);
            SimpleChess.AddIfPosible(result, boardSize, this.X + 2, this.Y - 1);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 2, this.Y + 1);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 2, this.Y - 1);

            SimpleChess.AddIfPosible(result, boardSize, this.X + 1, this.Y + 2);
            SimpleChess.AddIfPosible(result, boardSize, this.X + 1, this.Y - 2);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 1, this.Y + 2);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 1, this.Y - 2);
            return(result);
        }
Example #3
0
        public override List <KeyValuePair <int, int> > GetAvaliableMovements(int boardSize)
        {
            var result = new List <KeyValuePair <int, int> >();

            for (int i = 1; i < boardSize; i++)
            {
                //sol-üst çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X + i, this.Y + i);

                //sol-alt çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X + i, this.Y - i);

                //sağ-üst çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X - i, this.Y + i);

                //sol-alt çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X - i, this.Y - i);
            }
            return(result);
        }