private R2Plane()
 {
     planeNumber    = 1;
     planeDimension = 2;
     planeCentre    = new R2Point().Position;
     isR2Plane      = false;
     FillDirections();
 }
        public R2NCLetter()
        {
            letter         = new R2Letter <R2NCLetter, R2NCDirection>();
            letter.OnPlane = R2Plane.GetR2Plane();
            _startingPoint = new R2Point().Position;

            Fill();
        }
 public R2Letter(R2Plane onPlane, R2Point startingPoint,
                 List <int> directions, List <ISharedDirection> sharedDirections,
                 List <float> speedList, float speed, List <List <bool> > pointsCanSwitchList,
                 List <List <float> > pointsSpeedList)
 {
     letter = new Letter <R2Direction>(
         R2Plane.GetR2Plane(), startingPoint.Position, directions,
         sharedDirections, speedList, speed, pointsCanSwitchList,
         pointsSpeedList);
 }
        public R2CDirection(R2Point startingPoint, int direction, float xLength,
                            float yLength, float directionDivisor, List <float> speedList, List <bool>
                            canSwitchList, int numberOfRepeatations, bool canSwitch, float speed)
        {
            circularDirection = new CircularDirection <R2CDirection, R2Point>(
                canSwitchList, canSwitch, numberOfRepeatations);

            directionHelper = new R2Direction <R2CDirection>(startingPoint, direction,
                                                             xLength, yLength, directionDivisor, speedList, speed);


            InitializeAttributes();
        }
Exemplo n.º 5
0
        // Fill this direction with one of the eight possibilities.
        // Directio 1-7.
        // Any direction value correspond to Direction 8.
        public void Fill(MyLinkedList <R2Point> points)
        {
            points.Clear();

            R2Point point = new R2Point(direction.StartingPoint);

            points.Add(point);


            for (int i = 0; i < direction.SharedDirection.GetNumberOfElements(); i++)
            {
                switch (direction.MyDirection)
                {
                case 1:
                    points.Add(new R2Point(point.GetXCoordinate() - i * direction.SharedDirection.Divisor, point.GetYCoordinate()));
                    break;

                case 2:
                    points.Add(new R2Point(point.GetXCoordinate(), point.GetYCoordinate() + i * direction.SharedDirection.Divisor));
                    break;

                case 3:
                    points.Add(new R2Point(point.GetXCoordinate(), point.GetYCoordinate() - i * direction.SharedDirection.Divisor));
                    break;

                case 4:
                    points.Add(new R2Point(point.GetXCoordinate() - i * direction.SharedDirection.Divisor,
                                           point.GetYCoordinate() + i * direction.SharedDirection.Divisor));
                    break;

                case 5:
                    points.Add(new R2Point(point.GetXCoordinate() + i * direction.SharedDirection.Divisor,
                                           point.GetYCoordinate() - i * direction.SharedDirection.Divisor));
                    break;

                case 6:
                    points.Add(new R2Point(point.GetXCoordinate() + i * direction.SharedDirection.Divisor,
                                           point.GetYCoordinate() + i * direction.SharedDirection.Divisor));
                    break;

                case 7:
                    points.Add(new R2Point(point.GetXCoordinate() - i * direction.SharedDirection.Divisor,
                                           point.GetYCoordinate() - i * direction.SharedDirection.Divisor));
                    break;

                default:
                    points.Add(new R2Point(point.GetXCoordinate() + i * direction.SharedDirection.Divisor, point.GetYCoordinate()));
                    break;
                }
            }
        }
Exemplo n.º 6
0
        public R2Direction(R2Point startingPoint, int direction, float xLength,
                           float yLength, float divisor, List <float> speedList, float speed)
        {
            this.direction = new Direction <R2Point> (startingPoint.Position,
                                                      direction, new SharedDirection(xLength, yLength, divisor), speedList,
                                                      speed);

            this.direction.SharedDirection = new SharedDirection(xLength, yLength, divisor);

            this.direction.DirectionComponentLength = this.direction.SharedDirection.Length[
                this.direction.SharedDirection.Length.Count - 1] - this.direction.SharedDirection.Length[0];

            this.direction.MaximumDirection = 8;
        }
Exemplo n.º 7
0
        // Find the direction opposite to this direction.
        // The opposite direction starts on the last point of this direction.
        public R2Direction <IDirection> GetOppositeDirection(R2Point lastPoint)
        {
            int newDirection;

            switch (direction.MyDirection)
            {
            case 1:
                newDirection = 8;
                break;

            case 2:
                newDirection = 3;
                break;

            case 3:
                newDirection = 2;
                break;

            case 4:
                newDirection = 5;
                break;

            case 5:
                newDirection = 4;
                break;

            case 6:
                newDirection = 7;
                break;

            case 7:
                newDirection = 6;
                break;

            default:
                newDirection = 1;
                break;
            }

            SharedDirection shared = (SharedDirection)direction.SharedDirection;

            return(new R2Direction <IDirection>(lastPoint, newDirection,
                                                shared.XLength, shared.YLength, direction.SharedDirection.Divisor,
                                                direction.SpeedList, direction.Speed));
        }
Exemplo n.º 8
0
        // The starting point for the direction following this one when making a letter.
        public Point RetrieveNextStartingPoint(int direction, R2Point lastPoint)
        {
            Point newStartingPoint = lastPoint.Position;

            switch (direction)
            {
            case 1:
                newStartingPoint.SetAxisAt(0, lastPoint.Position.GetAxisAt(0) - this.direction.SharedDirection.Divisor);
                break;

            case 2:
                newStartingPoint.SetAxisAt(1, lastPoint.Position.GetAxisAt(1) + this.direction.SharedDirection.Divisor);
                break;

            case 3:
                newStartingPoint.SetAxisAt(1, lastPoint.Position.GetAxisAt(1) - this.direction.SharedDirection.Divisor);
                break;

            case 4:
                newStartingPoint.SetAxisAt(0, lastPoint.Position.GetAxisAt(0) - this.direction.SharedDirection.Divisor);
                newStartingPoint.SetAxisAt(1, lastPoint.Position.GetAxisAt(1) + this.direction.SharedDirection.Divisor);
                break;

            case 5:
                newStartingPoint.SetAxisAt(0, lastPoint.Position.GetAxisAt(0) + this.direction.SharedDirection.Divisor);
                newStartingPoint.SetAxisAt(1, lastPoint.Position.GetAxisAt(1) - this.direction.SharedDirection.Divisor);
                break;

            case 6:
                newStartingPoint.SetAxisAt(0, lastPoint.Position.GetAxisAt(0) + this.direction.SharedDirection.Divisor);
                newStartingPoint.SetAxisAt(1, lastPoint.Position.GetAxisAt(1) + this.direction.SharedDirection.Divisor);
                break;

            case 7:
                newStartingPoint.SetAxisAt(0, lastPoint.Position.GetAxisAt(0) - this.direction.SharedDirection.Divisor);
                newStartingPoint.SetAxisAt(1, lastPoint.Position.GetAxisAt(1) - this.direction.SharedDirection.Divisor);
                break;

            case 8:
                newStartingPoint.SetAxisAt(0, lastPoint.Position.GetAxisAt(0) + this.direction.SharedDirection.Divisor);
                break;
            }

            return(newStartingPoint);
        }
Exemplo n.º 9
0
        public R2CircularLetter(SharedDirection shareDirection)
        {
            onPlane = R2Plane.GetR2Plane();

            letter    = 'C';
            direction = 8;

            _startingPoint    = new R2Point().Position;
            smaller           = true;
            duration          = new Dictionary <int, int>();
            canShootList      = new List <bool>();
            numberOfRotations = 1;


            AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
            AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
            AddDirection(new R2Point(), 8, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
        }
Exemplo n.º 10
0
        public R2NonCircularLetter()
        {
            onPlane = R2Plane.GetR2Plane();

            letter    = 'C';
            direction = 8;

            _startingPoint       = new R2Point().Position;
            smaller              = true;
            duration             = new Dictionary <int, int>();
            canShootList         = new List <bool>();
            numberOfRepeatations = 1;


            AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
            AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);
            AddDirection(new R2Point(), 8, 10, 1, canShootList, duration, numberOfRepeatations);
        }
Exemplo n.º 11
0
        // Construct by specifying the number of rotations.
        public R2Direction(R2Point startingPoint, int direction, float directionLength,
                           float divisor, Dictionary <int, int> duration, int numberOfRotations)

        {
        }
Exemplo n.º 12
0
        // Construct without specifying the number of rotations.
        public R2Direction(R2Point startingPoint, int direction, float directionLength,
                           float directionDivisor, Dictionary <int, int> duration)

        {
        }
 public R2NonCircularShapeMovingStrategy(R2Point startingPoint, int movingStrategyNumber, ShapeTraceType traceType)
 {
 }
Exemplo n.º 14
0
        private void AddDirection(R2Point startingPoint, int direction, float directionLength,
                                  float directionDivisor, List <bool> canShootList, Dictionary <int, int> duration, int numberOfRotations)

        {
            circularLinkedList.Add(new R2CircularDirection(startingPoint, direction, directionLength, directionDivisor, canShootList, duration, numberOfRotations));
        }
Exemplo n.º 15
0
 private void AddDirection(int direction, R2Point startingPoint, float directionSize,
                           float directionDivisor, Dictionary <int, int> duration)
 {
     circularLinkedList.Add(new R2CircularDirection(startingPoint, direction, directionSize, directionDivisor, duration));
 }
Exemplo n.º 16
0
        public R2CircularLetter(R2Point startingPoint, char letter,
                                int letterDirection, bool smaller, Dictionary <int, int> duration,
                                int numberOfRotations, SharedDirection shareDirection)
            : base(startingPoint.Position, letter, letterDirection, R2Plane.GetR2Plane(),
                   smaller, duration, 2, numberOfRotations)
        {
            switch (Letter)
            {
            case 'C':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);


                break;

            case 'L':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRotations);

                break;

            case 'M':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);


                break;

            case 'N':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);



                break;

            case 'O':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);

                break;

            case 'R':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);



                break;

            case 'S':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);



                break;

            case 'W':

                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 1, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
                AddDirection(new R2Point(), 2, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);

                break;
            }
            AddDirection(new R2Point(), letterDirection, shareDirection.DirectionLength, shareDirection.Divisor, canShootList, duration, numberOfRotations);
        }
 public R2NCSMovingStrategy(R2Point startingPoint, int movingStrategyNumber, Secondary_Trace_Type traceType)
 {
 }
Exemplo n.º 18
0
        public R2NonCircularLetter(R2Point startingPoint, char letter, int letterDirection, bool smaller, Dictionary <int, int> duration)
            : base(startingPoint.Position, letter, letterDirection, R2Plane.GetR2Plane(), smaller, duration, 2)
        {
            switch (letter)
            {
            case 'C':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);


                break;

            case 'L':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);

                break;

            case 'M':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);


                break;

            case 'N':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);



                break;

            case 'O':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);

                break;

            case 'R':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);



                break;

            case 'S':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);



                break;

            case 'W':

                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 1, 10, 1, canShootList, duration, numberOfRepeatations);
                AddDirection(new R2Point(), 2, 10, 1, canShootList, duration, numberOfRepeatations);

                break;
            }
            AddDirection(new R2Point(), letterDirection, 10, 1, canShootList, duration, numberOfRepeatations);
        }
Exemplo n.º 19
0
 private void AddDirection(R2Point startingPoint, int direction, float directionLength,
                           float directionDivisor, List <bool> canShoot, Dictionary <int, int> duration)
 {
     doubleLinkedList.Add(new R2NonCircularDirection(startingPoint, direction, directionLength, directionDivisor, canShoot, duration));
 }
Exemplo n.º 20
0
        private void AddDirection(R2Point startingPoint, int direction, float directionLength,
                                  float divisor, Dictionary <int, int> duration, int numberOfRotations)

        {
            doubleLinkedList.Add(new R2NonCircularDirection(startingPoint, direction, directionLength, divisor, duration, numberOfRotations));
        }