コード例 #1
0
        public void AddTest()
        {
            Point         x = new Point(1, 5);
            VelocityPoint y = new VelocityPoint(-1, -2);

            Assert.True((x + y) == new Point(0, 3));
        }
コード例 #2
0
 public void UpdateScore(int score, VelocityPoint a1, VelocityPoint a2)
 {
     if (Score < score)
     {
         Agent1Way = a1;
         Agent2Way = a2;
     }
 }
コード例 #3
0
        void Initialize()
        {
            overwriteIndex = 0;
            points         = new VelocityPoint[runningAverageLength];

            for (int i = 0; i < pointCount; i++)
            {
                points[i] = new VelocityPoint(attenuationFactor);
            }
        }
コード例 #4
0
        public void PutAndGetVelocityPointTest()
        {
            Unsafe8Array <VelocityPoint> x = new Unsafe8Array <VelocityPoint>();

            x[0] = new VelocityPoint(1, 2);
            x[1] = new VelocityPoint(3, 4);
            x[2] = new VelocityPoint(5, 6);
            x[3] = new VelocityPoint(7, 8);
            x[4] = new VelocityPoint(-1, -2);
            x[5] = new VelocityPoint(-3, -4);
            x[6] = new VelocityPoint(-5, -6);
            x[7] = new VelocityPoint(-7, -8);
            Assert.True(x[0] == new VelocityPoint(1, 2));
            Assert.True(x[1] == new VelocityPoint(3, 4));
            Assert.True(x[2] == new VelocityPoint(5, 6));
            Assert.True(x[3] == new VelocityPoint(7, 8));
            Assert.True(x[4] == new VelocityPoint(-1, -2));
            Assert.True(x[5] == new VelocityPoint(-3, -4));
            Assert.True(x[6] == new VelocityPoint(-5, -6));
            Assert.True(x[7] == new VelocityPoint(-7, -8));
        }
コード例 #5
0
        static public AgentDirection CastPointToDir(VelocityPoint p)
        {
            int  x = p.X, y = p.Y;
            uint result = 0;

            if (x == 1)
            {
                result = (uint)AgentDirection.Right;
            }
            else if (x == -1)
            {
                result = (uint)AgentDirection.Left;
            }
            if (y == 1)
            {
                result |= (uint)AgentDirection.Down;
            }
            else if (y == -1)
            {
                result |= (uint)AgentDirection.Up;
            }
            return((AgentDirection)result);
        }
コード例 #6
0
 public Decided(VelocityPoint agent1, VelocityPoint agent2)
 {
     MeAgent1 = agent1;
     MeAgent2 = agent2;
 }
コード例 #7
0
 public Decided(VelocityPoint agent1, VelocityPoint agent2, int score)
 {
     MeAgent1 = agent1;
     MeAgent2 = agent2;
     Score    = score;
 }
コード例 #8
0
ファイル: Ways.cs プロジェクト: mct-procon/procon2018-AI-A
 public Way(VelocityPoint a1, VelocityPoint a2)
 {
     Agent1Way = a1;
     Agent2Way = a2;
     Point     = 0;
 }