找回密码
 注册
搜索
查看: 12085|回复: 2

[VB & C#] 泛型类ArrayList 貌似比grasshooper自己发明的List类方便很多,不用每次指定容器的类

[复制链接]
发表于 2013-7-17 07:14:04 | 显示全部楼层 |阅读模式
泛型类ArrayList 貌似比grasshooper自己发明的List类方便很多,不用每次指定容器的类型。
private void RunScript(int x, ref object A, ref object B)
  {
    ArrayList myAL = new ArrayList();
    for(int i = 0;i < x;i++)
      myAL.Add(x);
    A = myAL;

    List <int> myL = new List<int>();
    myL.Add(x);

    B = Util.addone(34, 12, 354, 2);
    // B = myL;
  }

  // <Custom additional code>
  class Util
  {
    public static int Min(params int[] paramListr)
    {
      int currentMin = paramListr[0];
      foreach (int i in paramListr)
      {
        if(i < currentMin)
        {
          currentMin = i;
        }
      }
      return currentMin;
    }

    public static ArrayList addone(params int[] paramListr)
    {
      ArrayList temp = new ArrayList();
      //int currentSum = 0;
      foreach (int i in paramListr)
      {
        temp.Add(i);
      }
      return temp;
    }
  }
  // </Custom additional code>
}

发表于 2013-7-17 10:13:46 | 显示全部楼层
QQ图片20130717101259.jpg
还是python随心所欲。
回复

使用道具 举报

发表于 2013-7-17 10:58:30 | 显示全部楼层
楼上 说对 还是 python 方便
回复

使用道具 举报

NCFZ微信公众号

手机版|小黑屋|NCF参数化建筑论坛 ( 浙ICP备2020044100号-2 ) 辽公网安备21021102000973号

GMT+8, 2026-11-23 19:28 , Processed in 0.049385 second(s), 30 queries , Gzip On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表