Beispiel #1
0
        /// <summary>
        /// Updates this StarSystem for the new time.
        /// </summary>
        /// <param name="deltaSeconds">Change in seconds since last update.</param>
        public void Update(int deltaSeconds)
        {
            // Update the position of all planets. This should probably be in something like the construction tick in Aurora.
            foreach (Star CurrentStar in Stars)
            {
                CurrentStar.UpdatePosition(deltaSeconds);

                // Since the star moved, update the JumpPoint position.
                foreach (JumpPoint CurrentJumpPoint in JumpPoints)
                {
                    CurrentJumpPoint.UpdatePosition();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Updates this StarSystem for the new time.
        /// </summary>
        /// <param name="deltaSeconds">Change in seconds since last update.</param>
        public void Update(int deltaSeconds)
        {
            // Update the position of all planets. This should probably be in something like the construction tick in Aurora.
            foreach (Star CurrentStar in Stars)
            {
                // The system primary will cause a divide by zero error currently as it has no orbit.
                if (CurrentStar != Stars[0])
                {
                    CurrentStar.UpdatePosition(deltaSeconds);

                    // Since the star moved, update the JumpPoint position.
                    foreach (JumpPoint CurrentJumpPoint in JumpPoints)
                    {
                        CurrentJumpPoint.UpdatePosition();
                    }
                }

                foreach (Planet CurrentPlanet in CurrentStar.Planets)
                {
                    CurrentPlanet.UpdatePosition(deltaSeconds);
                }
            }
        }