public bool isPlotClaimed(BuildingPlot plot)
{
// For each entry in the city plots list determine if the plot
// given as a parameter is allocated to another building, the road
// network etc.
foreach (BuildingPlot p in cityPlots)
{
if (plot.XPos >= p.XPos && plot.YPos >= p.YPos &&
(plot.XPos + plot.Width <= p.XPos + p.Width) &&
(plot.YPos + plot.Depth <= p.YPos + p.Depth))
{
// Plot specified is in this plots area. Determine if it has been
// claimed for anything other than part of a complex.
if (p.PlotClaimType == PlotClaimType.CLAIM_NONE)
return (false);
}
}
// Defaults to returning true to indicate whether regardless of whether the
// plot is actually claimed or not, safety fall through.
return (true);
}