public static IEnumerable<Point> GetMapFlags(MapInfo map)
{
var swf = map.ToSwf();
if (swf == null) return new Point[0];
return swf.Tags
.OfType<DefineSpriteTag>()
.SelectMany(sprite => sprite.ControlTags)
.OfType<PlaceObject2Tag>()
.Where(place => place.Name != null)
.Where(place => place.Name.StartsWith("flag"))
.Select(place => place.ToPoint())
.ToArray();
}