示例#1
0
        public override void AddRules()
        {
            base.AddRules();

            // *** PAWN DOUBLE MOVE *** //
            if (PawnDoubleMove && BerolinaPawn.Enabled)
            {
                MoveCapability doubleMoveNE = new MoveCapability();
                doubleMoveNE.MinSteps    = 2;
                doubleMoveNE.MaxSteps    = 2;
                doubleMoveNE.MustCapture = false;
                doubleMoveNE.CanCapture  = false;
                doubleMoveNE.Direction   = new Direction(1, 1);
                doubleMoveNE.Condition   = location => location.Rank == 1;
                BerolinaPawn.AddMoveCapability(doubleMoveNE);

                MoveCapability doubleMoveNW = new MoveCapability();
                doubleMoveNW.MinSteps    = 2;
                doubleMoveNW.MaxSteps    = 2;
                doubleMoveNW.MustCapture = false;
                doubleMoveNW.CanCapture  = false;
                doubleMoveNW.Direction   = new Direction(1, -1);
                doubleMoveNW.Condition   = location => location.Rank == 1;
                BerolinaPawn.AddMoveCapability(doubleMoveNW);
            }

            // *** EN-PASSANT *** //
            if (EnPassant && BerolinaPawn.Enabled)
            {
                AddRule(new Rules.Berolina.BerolinaEnPassantRule(BerolinaPawn));
            }
        }
示例#2
0
        public override void AddPieceTypes()
        {
            base.AddPieceTypes();
            AddPieceType(Rook   = new Rook("Rook", "R", 500, 550));
            AddPieceType(Bishop = new Bishop("Bishop", "B", 325, 350));
            AddPieceType(Knight = new Knight("Knight", "N", 325, 325));
            AddPieceType(Scout  = new Scout("Scout", "S", 300, 300));
            AddPieceType(Cleric = new Cleric("Cleric", "C", 475, 500));
            AddPieceType(Queen  = new Queen("Queen", "Q", 900, 1000));

            // *** CLERIC FIRST MOVE *** //
            MoveCapability clericMove = new MoveCapability();

            clericMove.MaxSteps  = 1;
            clericMove.Direction = new Direction(1, 3);
            clericMove.Condition = location => location.Rank == 0 && (location.File == 0 || location.File == 9);
            Cleric.AddMoveCapability(clericMove);
            clericMove           = new MoveCapability();
            clericMove.MaxSteps  = 1;
            clericMove.Direction = new Direction(1, -3);
            clericMove.Condition = location => location.Rank == 0 && (location.File == 0 || location.File == 9);
            Cleric.AddMoveCapability(clericMove);
            clericMove           = new MoveCapability();
            clericMove.MaxSteps  = 1;
            clericMove.Direction = new Direction(3, 1);
            clericMove.Condition = location => location.Rank == 0 && (location.File == 0 || location.File == 9);
            Cleric.AddMoveCapability(clericMove);
            clericMove           = new MoveCapability();
            clericMove.MaxSteps  = 1;
            clericMove.Direction = new Direction(3, -1);
            clericMove.Condition = location => location.Rank == 0 && (location.File == 0 || location.File == 9);
            Cleric.AddMoveCapability(clericMove);

            // *** SCOUT FIRST MOVE *** //
            MoveCapability scoutMove = new MoveCapability();

            scoutMove.MaxSteps  = 1;
            scoutMove.Direction = new Direction(1, 2);
            scoutMove.Condition = location => location.Rank == 0 && (location.File == 4 || location.File == 5);
            Scout.AddMoveCapability(scoutMove);
            scoutMove           = new MoveCapability();
            scoutMove.MaxSteps  = 1;
            scoutMove.Direction = new Direction(1, -2);
            scoutMove.Condition = location => location.Rank == 0 && (location.File == 4 || location.File == 5);
            Scout.AddMoveCapability(scoutMove);
            scoutMove           = new MoveCapability();
            scoutMove.MaxSteps  = 1;
            scoutMove.Direction = new Direction(2, 1);
            scoutMove.Condition = location => location.Rank == 0 && (location.File == 4 || location.File == 5);
            Scout.AddMoveCapability(scoutMove);
            scoutMove           = new MoveCapability();
            scoutMove.MaxSteps  = 1;
            scoutMove.Direction = new Direction(2, -1);
            scoutMove.Condition = location => location.Rank == 0 && (location.File == 4 || location.File == 5);
            Scout.AddMoveCapability(scoutMove);
        }
示例#3
0
        public static new void AddMoves(PieceType type)
        {
            Ferz.AddMoves(type);

            //	add the multi-path move
            MoveCapability move     = MoveCapability.Step(new Direction(2, 0));
            MovePathInfo   movePath = new MovePathInfo();

            movePath.AddPath(new List <Direction>()
            {
                new Direction(1, 1), new Direction(1, -1)
            });
            movePath.AddPath(new List <Direction>()
            {
                new Direction(1, -1), new Direction(1, 1)
            });
            move.PathInfo = movePath;
            type.AddMoveCapability(move);
        }