Skip to content

Instantly share code, notes, and snippets.

@kyubuns
Last active April 7, 2020 02:40
Show Gist options
  • Save kyubuns/1b4a99967052c7d1d94cacd0fe140305 to your computer and use it in GitHub Desktop.
Save kyubuns/1b4a99967052c7d1d94cacd0fe140305 to your computer and use it in GitHub Desktop.
@:generic
class ArrayWrapper<T>
{
public function new() {}
public var value: Array<T> = [];
#if cs
public function toTyped(): List_1<T>
{
var v = new List_1<T>();
for (e in value)
{
v.Add(e);
}
return v;
}
#end
}
@kyubuns
Copy link
Author

kyubuns commented Apr 6, 2020

abstractにするとhxUnserializeでthisを代入出来ない

@kyubuns
Copy link
Author

kyubuns commented Apr 7, 2020

private var _value: Arrayとして、
valueのgetterでList_1に変換しようとしたが、
hoge.value.push(123); が通らなくなってインターフェイスが微妙になってしまう、
全部再実装がいるしarrayaccessが通らなくなって不便なのでやめた

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment