Beispiel #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));
        }
Beispiel #2
0
 public void UpdateScore(int score, VelocityPoint a1, VelocityPoint a2)
 {
     if (Score < score)
     {
         Agent1Way = a1;
         Agent2Way = a2;
     }
 }
        void Initialize()
        {
            overwriteIndex = 0;
            points         = new VelocityPoint[runningAverageLength];

            for (int i = 0; i < pointCount; i++)
            {
                points[i] = new VelocityPoint(attenuationFactor);
            }
        }
Beispiel #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));
        }
        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);
        }
 public Decided(VelocityPoint agent1, VelocityPoint agent2)
 {
     MeAgent1 = agent1;
     MeAgent2 = agent2;
 }
Beispiel #7
0
 public Decided(VelocityPoint agent1, VelocityPoint agent2, int score)
 {
     MeAgent1 = agent1;
     MeAgent2 = agent2;
     Score    = score;
 }
Beispiel #8
0
 public Way(VelocityPoint a1, VelocityPoint a2)
 {
     Agent1Way = a1;
     Agent2Way = a2;
     Point     = 0;
 }