Beyond_Beyaan.Galaxy.GenerateTravelNode C# (CSharp) Метод

GenerateTravelNode() публичный Метод

public GenerateTravelNode ( float xPos, float yPos, StarSystem destination ) : TravelNode
xPos float
yPos float
destination StarSystem
Результат TravelNode
        public TravelNode GenerateTravelNode(float xPos, float yPos, StarSystem destination)
        {
            TravelNode newNode = new TravelNode();
            newNode.StarSystem = destination;
            float x = destination.X - xPos;
            float y = destination.Y - yPos;
            newNode.Length = (float)Math.Sqrt((x * x) + (y * y));
            newNode.Angle = (float)(Math.Atan2(y, x) * (180 / Math.PI));
            return newNode;
        }

Same methods

Galaxy::GenerateTravelNode ( StarSystem origin, StarSystem destination ) : TravelNode