예제 #1
0
        private IEnumerable <ILocation> BuildLocations()
        {
            if (Sheet.Collection.IsLibraAvailable)
            {
                return(BNpcName.Locations);
            }

            const int Count = 3;

            List <ILocation> locations = new List <ILocation>();

            IXivSheet <Map> maps = Sheet.Collection.GetSheet <Map>();

            for (int i = 0; i < Count; ++i)
            {
                PlaceName zone     = As <PlaceName>("PlaceName{Zone}", i);
                PlaceName location = As <PlaceName>("PlaceName{Location}", i);

                if (zone.Key != 0)
                {
                    locations.Add(new Location(zone, location));
                }
            }

            return(locations.ToArray());
        }
예제 #2
0
        private BNpcLocation[] BuildLocations(Libra.BNpcName libraRow)
        {
            List <BNpcLocation>   values     = new List <BNpcLocation>();
            IXivSheet <PlaceName> placeNames = Collection.Collection.GetSheet <PlaceName>();

            foreach (Tuple <int, Tuple <int, int[]>[]> srcRegion in libraRow.Regions)
            {
                PlaceName region = placeNames[srcRegion.Item1];

                foreach (Tuple <int, int[]> srcZone in srcRegion.Item2)
                {
                    PlaceName zone = placeNames[srcZone.Item1];
                    int       lvMin, lvMax;
                    if (srcZone.Item2.Length > 0)
                    {
                        lvMin = srcZone.Item2.Min();
                        lvMax = srcZone.Item2.Max();
                    }
                    else
                    {
                        lvMax = lvMin = 0;
                    }

                    values.Add(new BNpcLocation(region, zone, lvMin, lvMax));
                }
            }

            return(values.ToArray());
        }
예제 #3
0
 public BNpcLocation(PlaceName regionPlaceName, PlaceName placeName, int minimumLevel, int maximumLevel)
 {
     this.RegionPlaceName = regionPlaceName;
     this.PlaceName       = placeName;
     this.MinimumLevel    = minimumLevel;
     this.MaximumLevel    = maximumLevel;
 }
예제 #4
0
        static string ConvertPlaceNameName(Game.PlaceName sPlaceName)
        {
            // Shorten this name, it's way too long.
            if (sPlaceName.Key == 385)
            {
                return("Observatorium");
            }

            return(sPlaceName.Name.ToString());
        }
예제 #5
0
        private FateTarget[] BuildFates()
        {
            const int Count = 3;

            FateTarget[] fates = new FateTarget[Count];
            for (int i = 0; i < fates.Length; ++i)
            {
                Fate      fate  = As <Fate>("Fate", i);
                PlaceName place = As <PlaceName>("PlaceName{Fate}", i);

                fates[i] = new FateTarget(fate, place);
            }

            return(fates);
        }
예제 #6
0
        private ILocation[] BuildLocations()
        {
            Level[] levelLocations = BuildLevels();

            XivCollection coll = Collection.Collection;

            if (!coll.IsLibraAvailable)
            {
                return(levelLocations.Cast <ILocation>().ToArray());
            }

            var libraENpc = coll.Libra.ENpcResidents.FirstOrDefault(i => i.Key == this.Key);

            if (libraENpc == null)
            {
                return(levelLocations.ToArray());
            }

            List <ILocation> locations = new List <ILocation>();

            locations.AddRange(levelLocations.Cast <ILocation>());

            IXivSheet <PlaceName> placeNames = coll.GetSheet <PlaceName>();
            IXivSheet <Map>       maps       = coll.GetSheet <Map>();

            if (libraENpc.Coordinates != null)
            {
                foreach (var coord in libraENpc.Coordinates)
                {
                    PlaceName placeName = placeNames.First(i => i.Key == coord.Item1);

                    foreach (var c in coord.Item2)
                    {
                        // Only add if no Level exists in the same area.
                        if (!levelLocations.Any(l => Math.Abs(l.MapX - c.X) < 1 && Math.Abs(l.MapY - c.Y) < 1 && (l.Map.LocationPlaceName == placeName || l.Map.PlaceName == placeName || l.Map.RegionPlaceName == placeName)))
                        {
                            locations.Add(new GenericLocation(placeName, c.X, c.Y));
                        }
                    }
                }
            }

            return(locations.ToArray());
        }
예제 #7
0
 public LocationInfo(Game.PlaceName placeName, string fullName)
 {
     Name      = placeName.Name;
     FullName  = fullName;
     PlaceName = placeName;
 }
예제 #8
0
 public FateTarget(Fate fate, PlaceName placeName)
 {
     Fate      = fate;
     PlaceName = placeName;
 }
예제 #9
0
 public Location(PlaceName zonePlace, PlaceName locationPlace)
 {
     PlaceName         = zonePlace;
     LocationPlaceName = locationPlace;
 }
예제 #10
0
 public GenericLocation(PlaceName placeName, double x, double y)
 {
     this.MapX      = x;
     this.MapY      = y;
     this.PlaceName = placeName;
 }