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;
    }