Example #1
0
        /// <summary>
        /// Default Constructor for a Bishop piece
        /// </summary>
        public Bishop() : base()
        {
            Name = "Bishop";
            List <Movement> moves  = new List <Movement>();
            IConstraint     noJump = NoJumpConstraint.GetConstraint();
            IConstraint     unoc   = UnoccupiedConstraint.GetConstraint();

            moves.Add(new Movement(1, 1, 8));
            moves.Add(new Movement(1, -1, 8));
            moves.Add(new Movement(-1, 1, 8));
            moves.Add(new Movement(-1, -1, 8));
            foreach (Movement m in moves)
            {
                m.AddConstraint(noJump);
                m.AddConstraint(unoc);
            }
            PossibleMovements = moves;
        }
Example #2
0
        /// <summary>
        /// Default constructor for knight
        /// </summary>
        public Knight() : base()
        {
            Name = "Night";
            List <Movement> moves = new List <Movement>();
            IConstraint     unoc  = UnoccupiedConstraint.GetConstraint();

            moves.Add(new Movement(2, 1, 1));
            moves.Add(new Movement(1, 2, 1));
            moves.Add(new Movement(2, -1, 1));
            moves.Add(new Movement(1, -2, 1));
            moves.Add(new Movement(-2, 1, 1));
            moves.Add(new Movement(-1, 2, 1));
            moves.Add(new Movement(-2, -1, 1));
            moves.Add(new Movement(-1, -2, 1));
            foreach (Movement m in moves)
            {
                m.AddConstraint(unoc);
            }
            PossibleMovements = moves;
        }
Example #3
0
        /// <summary>
        /// default constructor
        /// </summary>
        internal Royal() : base()
        {
            Row    = 0;
            Column = 3;
            List <Movement> moves  = new List <Movement>();
            IConstraint     noJump = NoJumpConstraint.GetConstraint();
            IConstraint     unoc   = UnoccupiedConstraint.GetConstraint();

            moves.Add(new Movement(1, 1, 1));
            moves.Add(new Movement(0, 1, 1));
            moves.Add(new Movement(1, 0, 1));
            moves.Add(new Movement(1, -1, 1));
            moves.Add(new Movement(0, -1, 1));
            moves.Add(new Movement(-1, 0, 1));
            moves.Add(new Movement(-1, 1, 1));
            moves.Add(new Movement(-1, -1, 1));
            foreach (Movement m in moves)
            {
                m.AddConstraint(unoc);
                m.AddConstraint(noJump);
            }
            PossibleMovements = moves;
        }