【发布时间】:2017-07-02 20:25:30
【问题描述】:
我有这样的功能:
public static Mesh MeshFromPolylines(List<Polyline> nurbsCurves, int type, bool weld)
{
..code..
}
然后我有重载:
public static Mesh MeshFromPolylines(Polyline[] nurbsCurves, int type, bool weld)
{
..code..
}
有没有办法在不复制粘贴相同代码的情况下编写第二个函数?
这两个函数内部的代码完全相同。只是区别在于输入List<Polyline> 和Polyline[]。
【问题讨论】:
-
stackoverflow.com/questions/4482557/… 检查这个问题,字母“L”是 SOLID 原则 (stackoverflow.com/questions/13692126/…)
标签: c#