//#include "script_scene.hpp"

//#include "pw/scene/node.hpp"
#include "pw/scene/entity.hpp"
#include "pw/scene/scene.hpp"

#include "runtime_lua.hpp"

namespace sol {
    template <> struct is_automagical<pw::entity> : std::false_type {};
}

namespace pw {


void register_scene_function(sol::state&,sol::table &ns)
{

    ns.new_usertype<scene>("scene",
                           sol::call_constructor,sol::constructors<scene()>()
                        //    ,"count_all_entities",sol::readonly_property(&scene::count_all_enties)
                        //    ,"count_alive_entities",sol::readonly_property(&scene::count_alive_enties)
                           );


    ns.new_usertype<entity>("entity"
                            ,sol::call_constructor,sol::constructors<entity(),entity(const entity&),entity(scene&)>()
                            ,"add_child",&entity::add_child
                            ,"remove_child",&entity::remove_child
                            ,"child_count",sol::readonly_property(&entity::child_count)
                            );


//	ns.new_usertype<node>("node",
//						  sol::constructors<node()>(),
//						  "add_child",&node::add_child,
//						  "children",sol::readonly_property(&node::children),
//						  "parent",sol::readonly_property(&node::parent),
//						  "child_count",sol::readonly_property(&node::child_count),
//						  "create", []() -> std::shared_ptr<node> { return std::make_shared<node>(); },
//						  "is_leaf", sol::readonly_property(&node::is_leaf),
//						  "is_root", sol::readonly_property(&node::is_root),
//						  //								  "share",scripting::property(scripting::resolve<std::shared_ptr<node>(std::make_shared<node>))
//						  "name",sol::property(&node::name,&node::set_name)
//						  );
}

PW_REGISTER_LUA(scene)

}
