Ejemplo n.º 1
0
        public void SelectCelestialObject(ICelestialObject celestialObject)
        {
            Logger.Info("A celestial object is selected.");

            _gameSession.SelectedObject = celestialObject.DeepClone();

            OnSelectCelestialObject?.Invoke(celestialObject);
        }
        public GranularObjectInformation(ICelestialObject celestialObject, int drawInterval)
        {
            Id = celestialObject.Id;

            CelestialObject = celestialObject.DeepClone();

            WayPoints = Coordinates.GetWayPoints(
                new PointF(celestialObject.PreviousPositionX, celestialObject.PreviousPositionY),
                new PointF(celestialObject.PositionX, celestialObject.PositionY), drawInterval);
        }
Ejemplo n.º 3
0
        private void RefreshSelectedInfoControl(ICelestialObject celestialObject, SortedDictionary <int, GranularObjectInformation> granularObjectInformations, int i)
        {
            if (celestialObject == null)
            {
                OnRefreshSelectedCelestialObject?.Invoke(null, null);

                return;
            }

            var location = DrawMapTools.GetCurrentLocation(granularTurnInformation, celestialObject, turnStep, _screenParameters.DrawInterval);

            var selectedCelestialObject = celestialObject.DeepClone();

            selectedCelestialObject.PositionX = location.X;
            selectedCelestialObject.PositionY = location.Y;

            OnRefreshSelectedCelestialObject?.Invoke(selectedCelestialObject, _gameSession.GetPlayerSpaceShip());
        }
Ejemplo n.º 4
0
        public DrawMapDataObject(ICelestialObject previous, ICelestialObject current, int turn)
        {
            Id = current.Id;
            CurrentCelestialObject = current.DeepClone();

            positionFrom = new PointF(previous.PositionX, previous.PositionY);
            positionTo   = new PointF(current.PositionX, current.PositionY);

            WayPoints = Coordinates.GetWayPoints(
                new PointF(previous.PositionX, previous.PositionY),
                new PointF(current.PositionX, current.PositionY), 10);

            if (current.Id == 5005)
            {
                foreach (var wayPoint in WayPoints.Keys)
                {
                    Logger.Debug($"[PlayerShip] WeyPoint=({turn}.{wayPoint}) Position={WayPoints[wayPoint]} From={positionFrom} To={positionTo}");
                }
            }
        }