Exemplo n.º 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;
        }
Exemplo n.º 2
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;
        }