Exemple #1
0
        public List <LoadPosition> GetLoadPositions(SearchZone zone)
        {
            List <LoadPosition> loadPositions = new List <LoadPosition>();

            int deltaFrom = zone.DEFrom > 0 ? 1 : 0;
            int deltaTo   = zone.DETo > 0 ? 1 : 0;

            int fromZone = Math.Max(1, (int)(zone.DEFrom * 5) + 90 * 5 + deltaFrom);
            int toZone   = Math.Min(900, (int)(zone.DETo * 5) + 90 * 5 + deltaTo);

            for (int zoneId = fromZone; zoneId <= toZone; zoneId++)
            {
                LoadPosition loadPos = new LoadPosition();
                loadPos.ZoneId           = zoneId;
                loadPos.FirstStarNoInBin = 0;
                int raFrom = Math.Max(0, (int)Math.Floor(zone.RAFrom));
                int raTo   = Math.Min(360, (int)Math.Ceiling(zone.RATo) + 1);
                loadPos.FromRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raFrom];
                if (raTo == 360)
                {
                    loadPos.ToRecordId = (uint)ZoneIndex[zoneId - 1].TotalStarsInZone;
                }
                else
                {
                    loadPos.ToRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raTo];
                }

                loadPositions.Add(loadPos);
            }

            return(loadPositions);
        }
Exemple #2
0
        public List<LoadPosition> GetLoadPositions(SearchZone zone)
        {
            List<LoadPosition> loadPositions = new List<LoadPosition>();

            int deltaFrom = zone.DEFrom > 0 ? 1 : 0;
            int deltaTo = zone.DETo > 0 ? 1 : 0;

            int fromZone = Math.Max(1, (int)(zone.DEFrom * 5) + 90 * 5 + deltaFrom);
            int toZone = Math.Min(900, (int)(zone.DETo * 5) + 90 * 5 + deltaTo);

            for (int zoneId = fromZone; zoneId <= toZone; zoneId++)
            {
                LoadPosition loadPos = new LoadPosition();
                loadPos.ZoneId = zoneId;
                loadPos.FirstStarNoInBin = 0;
                int raFrom = Math.Max(0, (int)Math.Floor(zone.RAFrom));
                int raTo = Math.Min(360, (int)Math.Ceiling(zone.RATo) + 1);
                loadPos.FromRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raFrom];
                if (raTo == 360)
                    loadPos.ToRecordId = (uint)ZoneIndex[zoneId - 1].TotalStarsInZone;
                else
                    loadPos.ToRecordId = (uint)ZoneIndex[zoneId - 1].RAStartPositions[raTo];

                loadPositions.Add(loadPos);
            }

            return loadPositions;
        }