Buildings.CheckValidPlacement C# (CSharp) Метод

CheckValidPlacement() приватный Метод

check if new building placement is ok
private CheckValidPlacement ( Building, building ) : bool
building Building,
Результат bool
    private bool CheckValidPlacement(Building building)
    {
        //check this building with all other withing given distance
        foreach (Building other in this.BuildingsList)
            if (Vector3.Distance (building.Center, other.Center) > 25f)
                continue;
            else if (building.Intersects (other))
                return false;

        if (this.IntersectsRoad (building))
            return false;

        return true;
    }