I have a quite serious headache.
A middle-ware library has been developed for my project in Haxe (http://haxe.org/ ). Basically haxe is a meta language, to help cross platform and cross language development.
The problem is, the creator of the library used a lot of typedef-s which is a handy tool for avoiding a lot of class declarations (Typedef - Haxe - The Cross-platform Toolkit ).
The problem is, that the data sent in this structure has a type Object.
If I print it out it looks like a JSON or a JS object.
{ rounds : 804, strength : NaN, efficiency : NaN, win_ratio : NaN }
If you have any Idea or experience in dealing with such data, I would be glad to hear your ideas.
Have you tried any auto-map library in unity so far?
Thanks!
Update:
As @Bunny83 suggested I gathered more information. The library was build to form a layer between the server and the client, to avoid direct server calls from the client side code. Our library is a .NET assembly and it is part of the Unity project, so I have access to the source, and I could look up the calling method.
The actual type is “DynamicObject” which is not particularly helpful here.
As I went after the calling method. I have found that, the return type is actually haxe.ds.EnumValueMap which is a class made up by the haxe cross-compiler, and cast to DynamicObject.
return (((global::haxe.ds.EnumValueMap<object, object>) (global::haxe.ds.EnumValueMap<object, object>.__hx_cast<object, object>(((global::haxe.ds.EnumValueMap) (global::haxe.lang.Runtime.getField(p, "game_stats", 232010450, true)) ))) ).@get(t)).toDynamic();
In this point I don’t really know what to expect from you, I guess I have to Implement the cast from the EnumValueMap to a dictionary.
The haxe code is this in this particular example:
typedef GameStat = {
rounds: Int,
win_ratio: Float,
strength: Float,
efficiency: Float
}