Example #1
0
 public packet(SpriteBatch initSB, Texture2D initTexture, Node nodeA, Node nodeB)
 {
     source = nodeA;
     destination = nodeB;
     position = nodeA.getPosition();
     sb = initSB;
     pTexture = initTexture;
     Label = "";
 }
Example #2
0
 public packet(SpriteBatch initSB, Texture2D initTexture, Node nodeA, Node nodeB,string newLabel, SpriteFont fnt)
 {
     source = nodeA;
     destination = nodeB;
     position = nodeA.getPosition();
     sb = initSB;
     pTexture = initTexture;
     Label = newLabel;
     myFnt = fnt;
 }
Example #3
0
        public void addNeighbour(Node newNeighbour)
        {
            nS newN=new nS();
            newN.neighbor = newNeighbour;
            newN.timer = 1;
            neighboursNodes.Add(newN);

            PrimitiveLine tempLine = new PrimitiveLine(gd);
            /*
            if (getPosition().X == newNeighbour.getPosition().X)
            {
                tempLine.AddVector(getPosition() + new Vector2(5, 0));
                tempLine.AddVector(newNeighbour.getPosition());

                tempLine.AddVector(getPosition() + new Vector2(-5, 0));
                tempLine.AddVector(newNeighbour.getPosition());
            }
            else
            {

                tempLine.AddVector(getPosition()+new Vector2(0,5));
                tempLine.AddVector(newNeighbour.getPosition());

                tempLine.AddVector(getPosition() + new Vector2(0, -5));
                tempLine.AddVector(newNeighbour.getPosition());
            }*/

            //Simple line
            tempLine.AddVector(getPosition());
            tempLine.AddVector(newNeighbour.getPosition());

            neighbours.Add(tempLine);
        }