## API Reference
api
api.parser.json
api.parser.xml
api.url
api.util
api.protocol
api.ext.*
api.ext.exec(fn, ,..)
api.ecs
api.world
## Entity Component System (ECS) Read the Full Documentation here https://bakpakin.github.io/tiny-ecs/doc > Below are some helper functions to make things more efficient --- **commit()** ```lua obj = { foo = "bar", mycomponent = { a = 1 } } api.ecs.add( api.world, obj ) obj.foo = "flop" obj.commit('Xhappened') -- commit notifies all systems to rebuild entitycache -- because normally systems filter on an entitycache (=fast) -- which would still rely on foo = "bar". -- Only do this when you actually need a system to pick -- up on a change. ``` > also api.ext.exec('Xhappened') is called so extensions can respond to the change. ## api.parser.xml ```lua local xml = api.parser.xml.newParser() local testXml = [[ testThreeValue testThreeValueTwo testFourValue testTwoValue ]] util.traverseXML( xml:ParseXmlText(testXml), function(node,raw) print_r(node) -- { -- tag = "div", -- prop = { -- style = "color:red; display:none" -- } -- } end) ``` ## api.ext.* This is where extensions live. See the [skeleton extension](src/ext/skeleton/main.lua) for a typical extension startingpoint. ## api.ext.exec This allows batch-firing a function on each extension (if exist) ```lua api.ext.exec('init', 123, "foo") -- call .init(123,"foo") on each extension ```