Skip to content

An AS3 class. Encode AS3 object to Lua table. Decode Lua table string to AS3 object.

License

Notifications You must be signed in to change notification settings

czyang/SimpleLuaTable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

SimpleLuaTable

An AS3 class. Encode AS3 object to Lua table. Decode Lua table string to AS3 object.

###Input and output example AS3 object:

var as3Obj = new Object();
as3Obj["name"] = "foo";

<--->

Lua string:

return {
    name = "foo",
}

Limit: Not support array mixed table, like {a = 1, "a", 123, true}.

This class maybe overengineer. To encode Lua, just create a JSON, replace "[]:" to "{}=" and insert a "return" before the string. Limit is same.

Useage

// Encode
var luaTableString : String = SimpleLuaTable.encode(fooAS3Obj, true);

// Decode
var fooAs3Obj : Object = SimpleLuaTable.decode(luaTableString);  

About

An AS3 class. Encode AS3 object to Lua table. Decode Lua table string to AS3 object.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published