Esempio n. 1
0
    public override void Init(Color color)
    {
        Color = color;

        Step.setConstsFor(color);

        DefaultConstraints.SetupBuildDefaults();
        move = new Or(
            new Or(
                new Step(Step.FORWARD),
                new Step(Step.LEFT),
                new Step(Step.RIGHT)
                ).AddConstraint(new StartLevelConstraint(1, 2)),
            new Step(Step.DOWN).AddConstraint(new StartLevelConstraint(2))
            );

        DefaultConstraints.SetupBuildDefaults(new BlockAllyAndVoidCapture());
        capture = new Or(
            new Or(
                new Step(Step.LEFT_FORWARD),
                new Step(Step.RIGHT_FORWARD)
                ).AddConstraint(new StartLevelConstraint(1, 2)),
            new Step(Step.UP).AddConstraint(new StartLevelConstraint(1))
            );

        addBasicConstraints();
    }
Esempio n. 2
0
    public override void Init(Color color)
    {
        Color = color;

        Step.setConstsFor(color);

        DefaultConstraints.SetupBuildDefaults();
        move = new Or(
            new Step(Step.RIGHT_FORWARD),
            new Step(Step.RIGHT_BACKWARD),
            new Step(Step.LEFT_BACKWARD),
            new Step(Step.LEFT_FORWARD),

            new Step(2f * Step.RIGHT_BACKWARD),
            new Step(2f * Step.RIGHT_FORWARD),
            new Step(2f * Step.LEFT_BACKWARD),
            new Step(2f * Step.LEFT_FORWARD),

            new Step(Step.TRIAGONAL_DOWN_LEFT_BACKWARD),
            new Step(Step.TRIAGONAL_DOWN_LEFT_FORWARD),
            new Step(Step.TRIAGONAL_DOWN_RIGHT_BACKWARD),
            new Step(Step.TRIAGONAL_DOWN_RIGHT_FORWARD),
            new Step(Step.TRIAGONAL_UP_LEFT_BACKWARD),
            new Step(Step.TRIAGONAL_UP_LEFT_FORWARD),
            new Step(Step.TRIAGONAL_UP_RIGHT_BACKWARD),
            new Step(Step.TRIAGONAL_UP_RIGHT_FORWARD)
            ).AddConstraint(new StartLevelConstraint(2));

        DefaultConstraints.SetupBuildDefaults(new BlockAllyAndVoidCapture());
        capture = move.Clone();

        addBasicConstraints();
    }
Esempio n. 3
0
    public override void Init(Color color)
    {
        Color = color;

        Step.setConstsFor(color);

        DefaultConstraints.SetupBuildDefaults();
        move = new Or(
            new Or(
                new Step(Step.LEFT_FORWARD),
                new Step(Step.RIGHT_FORWARD)
                ).AddConstraint(new StartLevelConstraint(3)),
            new Or(
                color == Color.BLACK ? BlackLevelTwoMoves : WhiteLevelTwoMoves
                ).AddConstraint(new StartLevelConstraint(2))
            );

        DefaultConstraints.SetupBuildDefaults(new BlockAllyAndVoidCapture());
        capture = new Or(
            new Step(Step.DOWN),
            new Step(Step.FORWARD)
            ).AddConstraint(new StartLevelConstraint(3));

        addBasicConstraints();
    }
Esempio n. 4
0
        public String DropSubObjects()
        {
            StringBuilder script = new StringBuilder();

            script.Append(Indexes.DropAllScript());
            script.Append(UniqueConstraints.DropAllScript());
            if (PrimarKey != null)
            {
                script.AppendLine(PrimarKey.DropScript());
            }
            script.Append(CheckConstraints.DropAllScript());
            script.Append(DefaultConstraints.DropAllScript());
            return(script.ToString());
        }
Esempio n. 5
0
    public override void Init(Color color)
    {
        Color = color;

        DefaultConstraints.SetupBuildDefaults();
        move = new Or(
            new RoundMove().AddConstraint(new StartLevelConstraint(2)),
            new Step(Step.UP),
            new Step(Step.DOWN)
            );

        DefaultConstraints.SetupBuildDefaults(new BlockAllyAndVoidCapture());
        capture = move.Clone();

        addBasicConstraints();
    }
Esempio n. 6
0
    public override List <Vector3> GetAvailableCaptures(Vector3 startPosition, Board[] boards)
    {
        if (startPosition.z == 1)
        {
            oldpos = startPosition;

            return(capture.GetMovesFrom(startPosition, boards));
        }
        else
        {
            if (!oldpos.HasValue)
            {
                throw new UnassignedReferenceException("Hero's old position must be used but it's not assigned");
            }

            DefaultConstraints.SetupBuildDefaults(new BlockAllyAndVoidCapture());
            var move = new AbsoluteMove(oldpos.Value);
            move.AddConstraint(new BlockAllyAndVoidCapture(), new CheckConstraint());
            return(move.GetMovesFrom(startPosition, boards));
        }
    }
Esempio n. 7
0
        public String CreateSubObjects(Boolean withFk)
        {
            StringBuilder script = new StringBuilder();

            if (PrimarKey != null)
            {
                script.AppendLine(PrimarKey.CreateScript());
                script.AppendLine();
            }

            script.Append(UniqueConstraints.CreateAllScript());
            script.Append(Indexes.CreateAllScript());
            script.Append(CheckConstraints.CreateAllScript());
            script.Append(DefaultConstraints.CreateAllScript());

            if (withFk)
            {
                script.Append(ForeignKeys.CreateAllScript());
            }
            return(script.ToString());
        }
Esempio n. 8
0
    public override void Init(Color color)
    {
        Color = color;

        Step.setConstsFor(color);

        DefaultConstraints.SetupBuildDefaults();
        move = new Or(
            new Step(Step.FORWARD),
            new Step(Step.BACKWARD),
            new Step(Step.LEFT),
            new Step(Step.RIGHT),
            new UpToBorder(new Step(Step.RIGHT_FORWARD)),
            new UpToBorder(new Step(Step.RIGHT_BACKWARD)),
            new UpToBorder(new Step(Step.LEFT_BACKWARD)),
            new UpToBorder(new Step(Step.LEFT_FORWARD))
            ).AddConstraint(new StartLevelConstraint(3));

        DefaultConstraints.SetupBuildDefaults(new BlockAllyAndVoidCapture());
        capture = new Or(
            new Step(Step.FORWARD),
            new Step(Step.BACKWARD),
            new Step(Step.LEFT),
            new Step(Step.RIGHT),
            new UpToBorder(new Step(Step.RIGHT_FORWARD)),
            new UpToBorder(new Step(Step.RIGHT_BACKWARD)),
            new UpToBorder(new Step(Step.LEFT_BACKWARD)),
            new UpToBorder(new Step(Step.LEFT_FORWARD)),

            /* special moves */
            new Step(Step.DOWN),
            new Step(Step.DOWN + Step.FORWARD),
            new Step(Step.DOWN + Step.BACKWARD),
            new Step(Step.DOWN + Step.LEFT),
            new Step(Step.DOWN + Step.RIGHT)
            ).AddConstraint(new StartLevelConstraint(3));

        addBasicConstraints();
    }