如何编写使用Dictionary <t,u> .Enumerator with @:native extern

时间:2016-06-27 03:08:13

标签: haxe

似乎

@:native('System.Collections.Generic.Dictionary')
extern class Dictionary<T, U>

是有效的,但它似乎不适用于通用类的嵌套类。

我想写在Haxe,我自己的外语课程&#39;桥,像:

struct K {
   string x;
}

struct V {
   string y;
}

class Foo {
   public void foo(Dictionary<K, V> d) {
       Dictionary<K,V>.Enumerator e = d.GetEnumerator();
       while (e.MoveNext()) {
          Debug.Log(e.Current.Key.x);
          Debug.Log(e.Current.Value.y);
       }   
   }
}

0 个答案:

没有答案