public int CompareTo(object obj) { if (!(obj is MapLayout)) { return(-1); } MapLayout other = (MapLayout)obj; return(Id.CompareTo(other.Id)); }
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); }
public override bool Equals(object obj) { if (!(obj is MapLayout)) { return(false); } MapLayout other = (MapLayout)obj; return(Id == other.Id); }
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); }