Esempio n. 1
0
        public int CompareTo(object obj)
        {
            if (!(obj is MapLayout))
            {
                return(-1);
            }
            MapLayout other = (MapLayout)obj;

            return(Id.CompareTo(other.Id));
        }
Esempio n. 2
0
        public void AddAssociation(MapLayout map)
        {
            var mapKey = new Tuple <byte, byte>(map.Level, map.Area);

            if (!_maps.ContainsKey(mapKey))
            {
                _maps.Add(mapKey, new List <MapLayout>());
            }
            _maps[mapKey].Add(map);
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            if (!(obj is MapLayout))
            {
                return(false);
            }
            MapLayout other = (MapLayout)obj;

            return(Id == other.Id);
        }
Esempio n. 4
0
        public MapLayout GetBestMap(byte level, byte area, ushort loadingPoint, ushort missionLayout, float y)
        {
            List <MapLayout> mapList = GetLevelAreaMaps(level, area, loadingPoint, missionLayout);

            mapList = mapList.FindAll(map => map.Y <= y);
            if (mapList.Count == 0)
            {
                return(Config.MapAssociations.DefaultMap);
            }
            MapLayout bestMap = mapList.First();

            foreach (MapLayout map in mapList)
            {
                if (map.Y > bestMap.Y)
                {
                    bestMap = map;
                }
            }
            return(bestMap);
        }