コード例 #1
0
ファイル: Hero.cs プロジェクト: TelluricGames/DragonChess
    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();
    }
コード例 #2
0
ファイル: OrTest.cs プロジェクト: jeason0813/xFunc
        public void CloneTest()
        {
            var exp   = new Or(new Bool(true), new Bool(false));
            var clone = exp.Clone();

            Assert.Equal(exp, clone);
        }
コード例 #3
0
        public void CloneTest()
        {
            var lessThen    = new LessThan(Variable.X, new Number(10));
            var greaterThen = new GreaterThan(Variable.X, new Number(10));
            var exp         = new Or(lessThen, greaterThen);
            var clone       = exp.Clone();

            Assert.Equal(exp, clone);
        }
コード例 #4
0
        public void CloneTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", 0)
            };
            var lessThen    = new LessThan(Variable.X, new Number(10));
            var greaterThen = new GreaterThan(Variable.X, new Number(10));
            var exp         = new Or(lessThen, greaterThen);
            var clone       = exp.Clone();

            Assert.Equal(exp, clone);
        }
コード例 #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();
    }
コード例 #6
0
    public override void Init(Color color)
    {
        Color = color;

        Step.setConstsFor(color);

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

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

        addBasicConstraints();
    }