private void ComposeArea() { PointsOfInterest = Entrances .SelectMany(e => e.PointsOfInterest) .Where(p => p.BitFlagSet.Count > 0) .GroupBy(p => p.Coords, new SCCoordsEqualityComparer()) .Select(g => g.First()) .ToList(); Exits = PointsOfInterest.Where(p => p.Type == SCPointOfInterestType.Tele || p.Type == SCPointOfInterestType.Warp || p.Type == SCPointOfInterestType.Exit).Select(p => p.Teleport).ToList(); }
private void ProcessPointsOfInterest() { if (PointsOfInterest.Count > 250) { throw new NoYouDon_LowerCaseT_Exception(MapId, "Excess PointsOfInterest found."); } var conflicts = PointsOfInterest.Where(p => p.Type < SCPointOfInterestType.OwEntrance).GroupBy(p => p.Coords, new SCCoordsEqualityComparer()).Where(g => g.Count() > 1); if (conflicts.Any()) { throw new NopeException(MapId, "There is a PointOfInterest conflict."); } PointsOfInterest = PointsOfInterest.Distinct(new SCPointOfInterestEqualityComparer()).ToList(); Entrances = PointsOfInterest .Where(p => p.Type == SCPointOfInterestType.SmEntrance || p.Type == SCPointOfInterestType.OwEntrance) .Select(p => p.Coords) .Distinct() .Select(c => new SCEntrance(this, c)).ToList(); }