#include <hxcpp.h>

#ifndef INCLUDED_IMap
#include <IMap.h>
#endif
#ifndef INCLUDED_Lambda
#include <Lambda.h>
#endif
#ifndef INCLUDED_Luxe
#include <Luxe.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_haxe_ds_StringMap
#include <haxe/ds/StringMap.h>
#endif
#ifndef INCLUDED_luxe_Core
#include <luxe/Core.h>
#endif
#ifndef INCLUDED_luxe_Debug
#include <luxe/Debug.h>
#endif
#ifndef INCLUDED_luxe_Emitter
#include <luxe/Emitter.h>
#endif
#ifndef INCLUDED_luxe_Entity
#include <luxe/Entity.h>
#endif
#ifndef INCLUDED_luxe_Objects
#include <luxe/Objects.h>
#endif
#ifndef INCLUDED_luxe_Scene
#include <luxe/Scene.h>
#endif
#ifndef INCLUDED_snow_App
#include <snow/App.h>
#endif
namespace luxe{

Void Scene_obj::__construct(::String __o__name)
{
HX_STACK_FRAME("luxe.Scene","new",0x652ab566,"luxe.Scene.new","luxe/Scene.hx",11,0x14d4e1cb)

HX_STACK_ARG(__o__name,"_name")
::String _name = __o__name.Default(HX_CSTRING("untitled scene"));
{
	HX_STACK_LINE(20)
	this->length = (int)0;
	HX_STACK_LINE(15)
	this->started = false;
	HX_STACK_LINE(14)
	this->inited = false;
	HX_STACK_LINE(24)
	super::__construct(_name,null());
	HX_STACK_LINE(27)
	this->entities = ::haxe::ds::StringMap_obj::__new();
	HX_STACK_LINE(29)
	this->_delayed_init_entities = Array_obj< ::Dynamic >::__new();
	HX_STACK_LINE(30)
	this->_delayed_reset_entities = Array_obj< ::Dynamic >::__new();
	HX_STACK_LINE(32)
	::Luxe_obj::core->on(HX_CSTRING("init"),this->init_dyn());
	HX_STACK_LINE(33)
	::Luxe_obj::core->on(HX_CSTRING("destroy"),this->_destroy_dyn());
	HX_STACK_LINE(34)
	::Luxe_obj::core->on(HX_CSTRING("update"),this->update_dyn());
	HX_STACK_LINE(36)
	::Luxe_obj::core->on(HX_CSTRING("prerender"),this->prerender_dyn());
	HX_STACK_LINE(37)
	::Luxe_obj::core->on(HX_CSTRING("postrender"),this->postrender_dyn());
	HX_STACK_LINE(38)
	::Luxe_obj::core->on(HX_CSTRING("render"),this->render_dyn());
	HX_STACK_LINE(40)
	::Luxe_obj::core->on(HX_CSTRING("keydown"),this->keydown_dyn());
	HX_STACK_LINE(41)
	::Luxe_obj::core->on(HX_CSTRING("keyup"),this->keyup_dyn());
	HX_STACK_LINE(42)
	::Luxe_obj::core->on(HX_CSTRING("textinput"),this->textinput_dyn());
	HX_STACK_LINE(44)
	::Luxe_obj::core->on(HX_CSTRING("inputup"),this->inputup_dyn());
	HX_STACK_LINE(45)
	::Luxe_obj::core->on(HX_CSTRING("inputdown"),this->inputdown_dyn());
	HX_STACK_LINE(47)
	::Luxe_obj::core->on(HX_CSTRING("mouseup"),this->mouseup_dyn());
	HX_STACK_LINE(48)
	::Luxe_obj::core->on(HX_CSTRING("mousedown"),this->mousedown_dyn());
	HX_STACK_LINE(49)
	::Luxe_obj::core->on(HX_CSTRING("mousemove"),this->mousemove_dyn());
	HX_STACK_LINE(50)
	::Luxe_obj::core->on(HX_CSTRING("mousewheel"),this->mousewheel_dyn());
	HX_STACK_LINE(52)
	::Luxe_obj::core->on(HX_CSTRING("touchup"),this->touchup_dyn());
	HX_STACK_LINE(53)
	::Luxe_obj::core->on(HX_CSTRING("touchdown"),this->touchdown_dyn());
	HX_STACK_LINE(54)
	::Luxe_obj::core->on(HX_CSTRING("touchmove"),this->touchmove_dyn());
	HX_STACK_LINE(56)
	::Luxe_obj::core->on(HX_CSTRING("gamepadup"),this->gamepadup_dyn());
	HX_STACK_LINE(57)
	::Luxe_obj::core->on(HX_CSTRING("gamepaddown"),this->gamepaddown_dyn());
	HX_STACK_LINE(58)
	::Luxe_obj::core->on(HX_CSTRING("gamepadaxis"),this->gamepadaxis_dyn());
	HX_STACK_LINE(59)
	::Luxe_obj::core->on(HX_CSTRING("gamepaddevice"),this->gamepaddevice_dyn());
	HX_STACK_LINE(62)
	if ((::Luxe_obj::core->has_inited)){
		HX_STACK_LINE(63)
		this->init(null());
	}
}
;
	return null();
}

//Scene_obj::~Scene_obj() { }

Dynamic Scene_obj::__CreateEmpty() { return  new Scene_obj; }
hx::ObjectPtr< Scene_obj > Scene_obj::__new(::String __o__name)
{  hx::ObjectPtr< Scene_obj > result = new Scene_obj();
	result->__construct(__o__name);
	return result;}

Dynamic Scene_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< Scene_obj > result = new Scene_obj();
	result->__construct(inArgs[0]);
	return result;}

Void Scene_obj::add( ::luxe::Entity entity){
{
		HX_STACK_FRAME("luxe.Scene","add",0x6520d727,"luxe.Scene.add","luxe/Scene.hx",69,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(entity,"entity")
		HX_STACK_LINE(71)
		if (((entity == null()))){
			HX_STACK_LINE(72)
			HX_STACK_DO_THROW(HX_CSTRING("can't put entity in a scene if the entity is null."));
		}
		HX_STACK_LINE(78)
		entity->set_scene(hx::ObjectPtr<OBJ_>(this));
		HX_STACK_LINE(79)
		this->entities->set(entity->name,entity);
		HX_STACK_LINE(82)
		if ((this->inited)){
			HX_STACK_LINE(84)
			this->_delayed_init_entities->push(entity);
		}
		HX_STACK_LINE(87)
		if ((this->started)){
			HX_STACK_LINE(89)
			this->_delayed_reset_entities->push(entity);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,add,(void))

bool Scene_obj::remove( ::luxe::Entity entity){
	HX_STACK_FRAME("luxe.Scene","remove",0x2b461efe,"luxe.Scene.remove","luxe/Scene.hx",95,0x14d4e1cb)
	HX_STACK_THIS(this)
	HX_STACK_ARG(entity,"entity")
	HX_STACK_LINE(97)
	if (((entity == null()))){
		HX_STACK_LINE(98)
		HX_STACK_DO_THROW(HX_CSTRING("can't remove entity from a scene if the entity is null."));
	}
	HX_STACK_LINE(101)
	if (((entity->get_scene() == hx::ObjectPtr<OBJ_>(this)))){
		HX_STACK_LINE(103)
		entity->set_scene(null());
		HX_STACK_LINE(104)
		return this->entities->remove(entity->name);
	}
	else{
		HX_STACK_LINE(108)
		::haxe::Log_obj::trace(HX_CSTRING("    i / scene / can't remove the entity from this scene, it is not mine (entity.scene != this)"),hx::SourceInfo(HX_CSTRING("Scene.hx"),108,HX_CSTRING("luxe.Scene"),HX_CSTRING("remove")));
		HX_STACK_LINE(109)
		return false;
	}
	HX_STACK_LINE(113)
	return false;
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,remove,return )

Void Scene_obj::empty( ){
{
		HX_STACK_FRAME("luxe.Scene","empty",0xe3f8ed13,"luxe.Scene.empty","luxe/Scene.hx",120,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_LINE(120)
		for(::cpp::FastIterator_obj< ::luxe::Entity > *__it = ::cpp::CreateFastIterator< ::luxe::Entity >(this->entities->iterator());  __it->hasNext(); ){
			::luxe::Entity entity = __it->next();
			if (((entity != null()))){
				HX_STACK_LINE(123)
				this->remove(entity);
				HX_STACK_LINE(124)
				entity->destroy(null());
				HX_STACK_LINE(125)
				entity = null();
			}
;
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,empty,(void))

Void Scene_obj::render( Dynamic _){
{
		HX_STACK_FRAME("luxe.Scene","render",0x2be6ee10,"luxe.Scene.render","luxe/Scene.hx",136,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_,"_")
		HX_STACK_LINE(136)
		this->emit(HX_CSTRING("render"),null(),hx::SourceInfo(HX_CSTRING("Scene.hx"),136,HX_CSTRING("luxe.Scene"),HX_CSTRING("render")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,render,(void))

Void Scene_obj::prerender( Dynamic _){
{
		HX_STACK_FRAME("luxe.Scene","prerender",0x8547753f,"luxe.Scene.prerender","luxe/Scene.hx",142,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_,"_")
		HX_STACK_LINE(142)
		this->emit(HX_CSTRING("prerender"),null(),hx::SourceInfo(HX_CSTRING("Scene.hx"),142,HX_CSTRING("luxe.Scene"),HX_CSTRING("prerender")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,prerender,(void))

Void Scene_obj::postrender( Dynamic _){
{
		HX_STACK_FRAME("luxe.Scene","postrender",0x1efbdf70,"luxe.Scene.postrender","luxe/Scene.hx",148,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_,"_")
		HX_STACK_LINE(148)
		this->emit(HX_CSTRING("postrender"),null(),hx::SourceInfo(HX_CSTRING("Scene.hx"),148,HX_CSTRING("luxe.Scene"),HX_CSTRING("postrender")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,postrender,(void))

Void Scene_obj::keydown( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","keydown",0x70831d87,"luxe.Scene.keydown","luxe/Scene.hx",158,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(158)
		this->emit(HX_CSTRING("keydown"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),158,HX_CSTRING("luxe.Scene"),HX_CSTRING("keydown")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,keydown,(void))

Void Scene_obj::keyup( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","keyup",0x531d8840,"luxe.Scene.keyup","luxe/Scene.hx",166,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(166)
		this->emit(HX_CSTRING("keyup"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),166,HX_CSTRING("luxe.Scene"),HX_CSTRING("keyup")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,keyup,(void))

Void Scene_obj::textinput( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","textinput",0x19ef51c3,"luxe.Scene.textinput","luxe/Scene.hx",174,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(174)
		this->emit(HX_CSTRING("textinput"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),174,HX_CSTRING("luxe.Scene"),HX_CSTRING("textinput")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,textinput,(void))

Void Scene_obj::mousedown( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","mousedown",0x59faf28d,"luxe.Scene.mousedown","luxe/Scene.hx",184,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(184)
		this->emit(HX_CSTRING("mousedown"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),184,HX_CSTRING("luxe.Scene"),HX_CSTRING("mousedown")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,mousedown,(void))

Void Scene_obj::mousewheel( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","mousewheel",0x4d882010,"luxe.Scene.mousewheel","luxe/Scene.hx",192,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(192)
		this->emit(HX_CSTRING("mousewheel"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),192,HX_CSTRING("luxe.Scene"),HX_CSTRING("mousewheel")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,mousewheel,(void))

Void Scene_obj::mouseup( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","mouseup",0x7f87efc6,"luxe.Scene.mouseup","luxe/Scene.hx",200,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(200)
		this->emit(HX_CSTRING("mouseup"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),200,HX_CSTRING("luxe.Scene"),HX_CSTRING("mouseup")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,mouseup,(void))

Void Scene_obj::mousemove( Dynamic e){
{
		HX_STACK_FRAME("luxe.Scene","mousemove",0x5feddd3c,"luxe.Scene.mousemove","luxe/Scene.hx",208,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(e,"e")
		HX_STACK_LINE(208)
		this->emit(HX_CSTRING("mousemove"),e,hx::SourceInfo(HX_CSTRING("Scene.hx"),208,HX_CSTRING("luxe.Scene"),HX_CSTRING("mousemove")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,mousemove,(void))

Void Scene_obj::touchdown( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","touchdown",0x7312c927,"luxe.Scene.touchdown","luxe/Scene.hx",216,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(216)
		this->emit(HX_CSTRING("touchdown"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),216,HX_CSTRING("luxe.Scene"),HX_CSTRING("touchdown")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,touchdown,(void))

Void Scene_obj::touchup( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","touchup",0x980d0be0,"luxe.Scene.touchup","luxe/Scene.hx",222,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(222)
		this->emit(HX_CSTRING("touchup"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),222,HX_CSTRING("luxe.Scene"),HX_CSTRING("touchup")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,touchup,(void))

Void Scene_obj::touchmove( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","touchmove",0x7905b3d6,"luxe.Scene.touchmove","luxe/Scene.hx",228,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(228)
		this->emit(HX_CSTRING("touchmove"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),228,HX_CSTRING("luxe.Scene"),HX_CSTRING("touchmove")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,touchmove,(void))

Void Scene_obj::gamepadaxis( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","gamepadaxis",0xf55ebcc8,"luxe.Scene.gamepadaxis","luxe/Scene.hx",236,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(236)
		this->emit(HX_CSTRING("gamepadaxis"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),236,HX_CSTRING("luxe.Scene"),HX_CSTRING("gamepadaxis")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,gamepadaxis,(void))

Void Scene_obj::gamepadup( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","gamepadup",0xb549dec2,"luxe.Scene.gamepadup","luxe/Scene.hx",242,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(242)
		this->emit(HX_CSTRING("gamepadup"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),242,HX_CSTRING("luxe.Scene"),HX_CSTRING("gamepadup")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,gamepadup,(void))

Void Scene_obj::gamepaddown( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","gamepaddown",0xf7539889,"luxe.Scene.gamepaddown","luxe/Scene.hx",248,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(248)
		this->emit(HX_CSTRING("gamepaddown"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),248,HX_CSTRING("luxe.Scene"),HX_CSTRING("gamepaddown")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,gamepaddown,(void))

Void Scene_obj::gamepaddevice( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","gamepaddevice",0x6323147d,"luxe.Scene.gamepaddevice","luxe/Scene.hx",254,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(254)
		this->emit(HX_CSTRING("gamepaddevice"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),254,HX_CSTRING("luxe.Scene"),HX_CSTRING("gamepaddevice")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,gamepaddevice,(void))

Void Scene_obj::inputdown( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","inputdown",0x74d0f6f2,"luxe.Scene.inputdown","luxe/Scene.hx",262,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(262)
		this->emit(HX_CSTRING("inputdown"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),262,HX_CSTRING("luxe.Scene"),HX_CSTRING("inputdown")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,inputdown,(void))

Void Scene_obj::inputup( Dynamic event){
{
		HX_STACK_FRAME("luxe.Scene","inputup",0x9333a0eb,"luxe.Scene.inputup","luxe/Scene.hx",268,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(event,"event")
		HX_STACK_LINE(268)
		this->emit(HX_CSTRING("inputup"),event,hx::SourceInfo(HX_CSTRING("Scene.hx"),268,HX_CSTRING("luxe.Scene"),HX_CSTRING("inputup")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,inputup,(void))

Void Scene_obj::_destroy( Dynamic _){
{
		HX_STACK_FRAME("luxe.Scene","_destroy",0xd16dabb5,"luxe.Scene._destroy","luxe/Scene.hx",276,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_,"_")
		HX_STACK_LINE(276)
		this->destroy();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,_destroy,(void))

Void Scene_obj::destroy( ){
{
		HX_STACK_FRAME("luxe.Scene","destroy",0xe39b0d00,"luxe.Scene.destroy","luxe/Scene.hx",280,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_LINE(282)
		::Luxe_obj::core->off(HX_CSTRING("init"),this->init_dyn());
		HX_STACK_LINE(283)
		::Luxe_obj::core->off(HX_CSTRING("destroy"),this->_destroy_dyn());
		HX_STACK_LINE(284)
		::Luxe_obj::core->off(HX_CSTRING("update"),this->update_dyn());
		HX_STACK_LINE(286)
		::Luxe_obj::core->off(HX_CSTRING("prerender"),this->prerender_dyn());
		HX_STACK_LINE(287)
		::Luxe_obj::core->off(HX_CSTRING("postrender"),this->postrender_dyn());
		HX_STACK_LINE(288)
		::Luxe_obj::core->off(HX_CSTRING("render"),this->render_dyn());
		HX_STACK_LINE(290)
		::Luxe_obj::core->off(HX_CSTRING("keydown"),this->keydown_dyn());
		HX_STACK_LINE(291)
		::Luxe_obj::core->off(HX_CSTRING("keyup"),this->keyup_dyn());
		HX_STACK_LINE(292)
		::Luxe_obj::core->off(HX_CSTRING("textinput"),this->textinput_dyn());
		HX_STACK_LINE(294)
		::Luxe_obj::core->off(HX_CSTRING("inputup"),this->inputup_dyn());
		HX_STACK_LINE(295)
		::Luxe_obj::core->off(HX_CSTRING("inputdown"),this->inputdown_dyn());
		HX_STACK_LINE(297)
		::Luxe_obj::core->off(HX_CSTRING("mouseup"),this->mouseup_dyn());
		HX_STACK_LINE(298)
		::Luxe_obj::core->off(HX_CSTRING("mousedown"),this->mousedown_dyn());
		HX_STACK_LINE(299)
		::Luxe_obj::core->off(HX_CSTRING("mousemove"),this->mousemove_dyn());
		HX_STACK_LINE(300)
		::Luxe_obj::core->off(HX_CSTRING("mousewheel"),this->mousewheel_dyn());
		HX_STACK_LINE(302)
		::Luxe_obj::core->off(HX_CSTRING("touchup"),this->touchup_dyn());
		HX_STACK_LINE(303)
		::Luxe_obj::core->off(HX_CSTRING("touchdown"),this->touchdown_dyn());
		HX_STACK_LINE(304)
		::Luxe_obj::core->off(HX_CSTRING("touchmove"),this->touchmove_dyn());
		HX_STACK_LINE(306)
		::Luxe_obj::core->off(HX_CSTRING("gamepadup"),this->gamepadup_dyn());
		HX_STACK_LINE(307)
		::Luxe_obj::core->off(HX_CSTRING("gamepaddown"),this->gamepaddown_dyn());
		HX_STACK_LINE(308)
		::Luxe_obj::core->off(HX_CSTRING("gamepadaxis"),this->gamepadaxis_dyn());
		HX_STACK_LINE(309)
		::Luxe_obj::core->off(HX_CSTRING("gamepaddevice"),this->gamepaddevice_dyn());
		HX_STACK_LINE(311)
		this->emit(HX_CSTRING("destroy"),null(),hx::SourceInfo(HX_CSTRING("Scene.hx"),311,HX_CSTRING("luxe.Scene"),HX_CSTRING("destroy")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,destroy,(void))

bool Scene_obj::_do_init( ){
	HX_STACK_FRAME("luxe.Scene","_do_init",0x45b3463f,"luxe.Scene._do_init","luxe/Scene.hx",315,0x14d4e1cb)
	HX_STACK_THIS(this)
	HX_STACK_LINE(317)
	int _before_count = this->get_length();		HX_STACK_VAR(_before_count,"_before_count");
	HX_STACK_LINE(319)
	for(::cpp::FastIterator_obj< ::luxe::Entity > *__it = ::cpp::CreateFastIterator< ::luxe::Entity >(this->entities->iterator());  __it->hasNext(); ){
		::luxe::Entity entity = __it->next();
		if (((entity != null()))){
			HX_STACK_LINE(321)
			if ((!(entity->inited))){
				HX_STACK_LINE(323)
				entity->_init();
			}
		}
;
	}
	HX_STACK_LINE(328)
	int _after_count = this->get_length();		HX_STACK_VAR(_after_count,"_after_count");
	HX_STACK_LINE(330)
	return (_before_count != _after_count);
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,_do_init,return )

Void Scene_obj::init( Dynamic _){
{
		HX_STACK_FRAME("luxe.Scene","init",0x1cecbb4a,"luxe.Scene.init","luxe/Scene.hx",336,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(_,"_")
		HX_STACK_LINE(338)
		bool keep_going = true;		HX_STACK_VAR(keep_going,"keep_going");
		HX_STACK_LINE(339)
		while((keep_going)){
			HX_STACK_LINE(340)
			keep_going = this->_do_init();
		}
		HX_STACK_LINE(343)
		this->inited = true;
		HX_STACK_LINE(345)
		this->emit(HX_CSTRING("init"),null(),hx::SourceInfo(HX_CSTRING("Scene.hx"),345,HX_CSTRING("luxe.Scene"),HX_CSTRING("init")));
		HX_STACK_LINE(347)
		this->reset();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,init,(void))

Void Scene_obj::reset( ){
{
		HX_STACK_FRAME("luxe.Scene","reset",0x5ae6fc55,"luxe.Scene.reset","luxe/Scene.hx",352,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_LINE(354)
		this->started = false;
		HX_STACK_LINE(356)
		this->emit(HX_CSTRING("reset"),null(),hx::SourceInfo(HX_CSTRING("Scene.hx"),356,HX_CSTRING("luxe.Scene"),HX_CSTRING("reset")));
		HX_STACK_LINE(358)
		this->started = true;
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,reset,(void))

Void Scene_obj::update( Float dt){
{
		HX_STACK_FRAME("luxe.Scene","update",0xadc308c3,"luxe.Scene.update","luxe/Scene.hx",362,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_ARG(dt,"dt")
		HX_STACK_LINE(364)
		::Luxe_obj::core->debug->start((HX_CSTRING("scene.") + this->name));
		HX_STACK_LINE(367)
		this->handle_delayed_additions();
		HX_STACK_LINE(369)
		this->emit(HX_CSTRING("update"),dt,hx::SourceInfo(HX_CSTRING("Scene.hx"),369,HX_CSTRING("luxe.Scene"),HX_CSTRING("update")));
		HX_STACK_LINE(372)
		for(::cpp::FastIterator_obj< ::luxe::Entity > *__it = ::cpp::CreateFastIterator< ::luxe::Entity >(this->entities->iterator());  __it->hasNext(); ){
			::luxe::Entity entity = __it->next();
			if (((entity != null()))){
				HX_STACK_LINE(374)
				entity->_update(dt);
			}
;
		}
		HX_STACK_LINE(378)
		::Luxe_obj::core->debug->end((HX_CSTRING("scene.") + this->name));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(Scene_obj,update,(void))

Void Scene_obj::handle_delayed_additions( ){
{
		HX_STACK_FRAME("luxe.Scene","handle_delayed_additions",0xbf640c7d,"luxe.Scene.handle_delayed_additions","luxe/Scene.hx",382,0x14d4e1cb)
		HX_STACK_THIS(this)
		HX_STACK_LINE(384)
		if (((bool((this->_delayed_init_entities->length != (int)0)) || bool((this->_delayed_reset_entities->length != (int)0))))){
			HX_STACK_LINE(138)
			Dynamic();
		}
		HX_STACK_LINE(388)
		if (((this->_delayed_init_entities->length > (int)0))){
			HX_STACK_LINE(389)
			{
				HX_STACK_LINE(389)
				int _g = (int)0;		HX_STACK_VAR(_g,"_g");
				HX_STACK_LINE(389)
				Array< ::Dynamic > _g1 = this->_delayed_init_entities;		HX_STACK_VAR(_g1,"_g1");
				HX_STACK_LINE(389)
				while(((_g < _g1->length))){
					HX_STACK_LINE(389)
					::luxe::Entity entity = _g1->__get(_g).StaticCast< ::luxe::Entity >();		HX_STACK_VAR(entity,"entity");
					HX_STACK_LINE(389)
					++(_g);
					HX_STACK_LINE(391)
					entity->_init();
				}
			}
			HX_STACK_LINE(393)
			this->_delayed_init_entities->splice((int)0,this->_delayed_init_entities->length);
		}
		HX_STACK_LINE(396)
		if (((this->_delayed_reset_entities->length > (int)0))){
			HX_STACK_LINE(397)
			{
				HX_STACK_LINE(397)
				int _g = (int)0;		HX_STACK_VAR(_g,"_g");
				HX_STACK_LINE(397)
				Array< ::Dynamic > _g1 = this->_delayed_reset_entities;		HX_STACK_VAR(_g1,"_g1");
				HX_STACK_LINE(397)
				while(((_g < _g1->length))){
					HX_STACK_LINE(397)
					::luxe::Entity entity = _g1->__get(_g).StaticCast< ::luxe::Entity >();		HX_STACK_VAR(entity,"entity");
					HX_STACK_LINE(397)
					++(_g);
					HX_STACK_LINE(399)
					entity->_reset(null());
				}
			}
			HX_STACK_LINE(401)
			this->_delayed_reset_entities->splice((int)0,this->_delayed_reset_entities->length);
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,handle_delayed_additions,(void))

int Scene_obj::get_length( ){
	HX_STACK_FRAME("luxe.Scene","get_length",0x88bd6c69,"luxe.Scene.get_length","luxe/Scene.hx",408,0x14d4e1cb)
	HX_STACK_THIS(this)
	HX_STACK_LINE(408)
	return ::Lambda_obj::count(this->entities,null());
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,get_length,return )

::String Scene_obj::toString( ){
	HX_STACK_FRAME("luxe.Scene","toString",0xab9df5e6,"luxe.Scene.toString","luxe/Scene.hx",414,0x14d4e1cb)
	HX_STACK_THIS(this)
	HX_STACK_LINE(414)
	return (((((HX_CSTRING("luxe Scene: ") + this->name) + HX_CSTRING(" / ")) + this->get_length()) + HX_CSTRING(" entities / id: ")) + this->id);
}


HX_DEFINE_DYNAMIC_FUNC0(Scene_obj,toString,return )


Scene_obj::Scene_obj()
{
}

void Scene_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(Scene);
	HX_MARK_MEMBER_NAME(entities,"entities");
	HX_MARK_MEMBER_NAME(inited,"inited");
	HX_MARK_MEMBER_NAME(started,"started");
	HX_MARK_MEMBER_NAME(_delayed_init_entities,"_delayed_init_entities");
	HX_MARK_MEMBER_NAME(_delayed_reset_entities,"_delayed_reset_entities");
	HX_MARK_MEMBER_NAME(length,"length");
	::luxe::Objects_obj::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void Scene_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(entities,"entities");
	HX_VISIT_MEMBER_NAME(inited,"inited");
	HX_VISIT_MEMBER_NAME(started,"started");
	HX_VISIT_MEMBER_NAME(_delayed_init_entities,"_delayed_init_entities");
	HX_VISIT_MEMBER_NAME(_delayed_reset_entities,"_delayed_reset_entities");
	HX_VISIT_MEMBER_NAME(length,"length");
	::luxe::Objects_obj::__Visit(HX_VISIT_ARG);
}

Dynamic Scene_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"add") ) { return add_dyn(); }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"init") ) { return init_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"empty") ) { return empty_dyn(); }
		if (HX_FIELD_EQ(inName,"keyup") ) { return keyup_dyn(); }
		if (HX_FIELD_EQ(inName,"reset") ) { return reset_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"inited") ) { return inited; }
		if (HX_FIELD_EQ(inName,"length") ) { return inCallProp ? get_length() : length; }
		if (HX_FIELD_EQ(inName,"remove") ) { return remove_dyn(); }
		if (HX_FIELD_EQ(inName,"render") ) { return render_dyn(); }
		if (HX_FIELD_EQ(inName,"update") ) { return update_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"started") ) { return started; }
		if (HX_FIELD_EQ(inName,"keydown") ) { return keydown_dyn(); }
		if (HX_FIELD_EQ(inName,"mouseup") ) { return mouseup_dyn(); }
		if (HX_FIELD_EQ(inName,"touchup") ) { return touchup_dyn(); }
		if (HX_FIELD_EQ(inName,"inputup") ) { return inputup_dyn(); }
		if (HX_FIELD_EQ(inName,"destroy") ) { return destroy_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"entities") ) { return entities; }
		if (HX_FIELD_EQ(inName,"_destroy") ) { return _destroy_dyn(); }
		if (HX_FIELD_EQ(inName,"_do_init") ) { return _do_init_dyn(); }
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"prerender") ) { return prerender_dyn(); }
		if (HX_FIELD_EQ(inName,"textinput") ) { return textinput_dyn(); }
		if (HX_FIELD_EQ(inName,"mousedown") ) { return mousedown_dyn(); }
		if (HX_FIELD_EQ(inName,"mousemove") ) { return mousemove_dyn(); }
		if (HX_FIELD_EQ(inName,"touchdown") ) { return touchdown_dyn(); }
		if (HX_FIELD_EQ(inName,"touchmove") ) { return touchmove_dyn(); }
		if (HX_FIELD_EQ(inName,"gamepadup") ) { return gamepadup_dyn(); }
		if (HX_FIELD_EQ(inName,"inputdown") ) { return inputdown_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"postrender") ) { return postrender_dyn(); }
		if (HX_FIELD_EQ(inName,"mousewheel") ) { return mousewheel_dyn(); }
		if (HX_FIELD_EQ(inName,"get_length") ) { return get_length_dyn(); }
		break;
	case 11:
		if (HX_FIELD_EQ(inName,"gamepadaxis") ) { return gamepadaxis_dyn(); }
		if (HX_FIELD_EQ(inName,"gamepaddown") ) { return gamepaddown_dyn(); }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"gamepaddevice") ) { return gamepaddevice_dyn(); }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"_delayed_init_entities") ) { return _delayed_init_entities; }
		break;
	case 23:
		if (HX_FIELD_EQ(inName,"_delayed_reset_entities") ) { return _delayed_reset_entities; }
		break;
	case 24:
		if (HX_FIELD_EQ(inName,"handle_delayed_additions") ) { return handle_delayed_additions_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic Scene_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 6:
		if (HX_FIELD_EQ(inName,"inited") ) { inited=inValue.Cast< bool >(); return inValue; }
		if (HX_FIELD_EQ(inName,"length") ) { length=inValue.Cast< int >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"started") ) { started=inValue.Cast< bool >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"entities") ) { entities=inValue.Cast< ::haxe::ds::StringMap >(); return inValue; }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"_delayed_init_entities") ) { _delayed_init_entities=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
		break;
	case 23:
		if (HX_FIELD_EQ(inName,"_delayed_reset_entities") ) { _delayed_reset_entities=inValue.Cast< Array< ::Dynamic > >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void Scene_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("entities"));
	outFields->push(HX_CSTRING("inited"));
	outFields->push(HX_CSTRING("started"));
	outFields->push(HX_CSTRING("_delayed_init_entities"));
	outFields->push(HX_CSTRING("_delayed_reset_entities"));
	outFields->push(HX_CSTRING("length"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
	{hx::fsObject /*::haxe::ds::StringMap*/ ,(int)offsetof(Scene_obj,entities),HX_CSTRING("entities")},
	{hx::fsBool,(int)offsetof(Scene_obj,inited),HX_CSTRING("inited")},
	{hx::fsBool,(int)offsetof(Scene_obj,started),HX_CSTRING("started")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Scene_obj,_delayed_init_entities),HX_CSTRING("_delayed_init_entities")},
	{hx::fsObject /*Array< ::Dynamic >*/ ,(int)offsetof(Scene_obj,_delayed_reset_entities),HX_CSTRING("_delayed_reset_entities")},
	{hx::fsInt,(int)offsetof(Scene_obj,length),HX_CSTRING("length")},
	{ hx::fsUnknown, 0, null()}
};
#endif

static ::String sMemberFields[] = {
	HX_CSTRING("entities"),
	HX_CSTRING("inited"),
	HX_CSTRING("started"),
	HX_CSTRING("_delayed_init_entities"),
	HX_CSTRING("_delayed_reset_entities"),
	HX_CSTRING("length"),
	HX_CSTRING("add"),
	HX_CSTRING("remove"),
	HX_CSTRING("empty"),
	HX_CSTRING("render"),
	HX_CSTRING("prerender"),
	HX_CSTRING("postrender"),
	HX_CSTRING("keydown"),
	HX_CSTRING("keyup"),
	HX_CSTRING("textinput"),
	HX_CSTRING("mousedown"),
	HX_CSTRING("mousewheel"),
	HX_CSTRING("mouseup"),
	HX_CSTRING("mousemove"),
	HX_CSTRING("touchdown"),
	HX_CSTRING("touchup"),
	HX_CSTRING("touchmove"),
	HX_CSTRING("gamepadaxis"),
	HX_CSTRING("gamepadup"),
	HX_CSTRING("gamepaddown"),
	HX_CSTRING("gamepaddevice"),
	HX_CSTRING("inputdown"),
	HX_CSTRING("inputup"),
	HX_CSTRING("_destroy"),
	HX_CSTRING("destroy"),
	HX_CSTRING("_do_init"),
	HX_CSTRING("init"),
	HX_CSTRING("reset"),
	HX_CSTRING("update"),
	HX_CSTRING("handle_delayed_additions"),
	HX_CSTRING("get_length"),
	HX_CSTRING("toString"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(Scene_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(Scene_obj::__mClass,"__mClass");
};

#endif

Class Scene_obj::__mClass;

void Scene_obj::__register()
{
	hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("luxe.Scene"), hx::TCanCast< Scene_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
    , sMemberStorageInfo
#endif
);
}

void Scene_obj::__boot()
{
}

} // end namespace luxe
