public static int ComparyByCost(IZone zone1, IZone zone2) { IPark z1 = (IPark)zone1; IPark z2 = (IPark)zone2; if (z1.GetCost() < z2.GetCost()) { return(1); } else if (z1.GetCost() > z2.GetCost()) { return(-1); } return(0); }
internal string GetInfoZone(string zoneName) { bool[] filters = filterControl.GetFiltersInformation(); IZone zone = parkSystem.GetZone(zoneName); string infoZone = GetDefaultInfoZone(zone); IPark park = (IPark)zone; if (filters[FilterControl.COST]) { infoZone += "Precio total: " + "\n" + park.GetCost() + "\n"; } if (filters[FilterControl.SCHEDULE]) { infoZone += "Horario de apertura: " + park.GetSchedule() + "\n"; } if (filters[FilterControl.VISITS]) { infoZone += "Visitas Ultimos dos años: " + (park.GetVisits().GetTotalVisits((DateTime.Now.Year - 6) + "") + park.GetVisits().GetTotalVisits((DateTime.Now.Year - 7) + "")) + "\n"; } if (filters[FilterControl.FORECAST]) { infoZone += "Pronostico de visitas: " + park.GetVisits().GetForecastVisits("2018") + "\n"; } infoZone += GetDefaultInfoPolygon(zone.GetPolygonArea()); return(infoZone); }