@awayfl/awayfl-player
Version:
Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript
1,736 lines (1,733 loc) • 3.31 MB
JavaScript
(function(){
"use strict";
var nape, zpp_nape, js, Std, Reflect, StringTools;
var $_, $estr = function() { return js.Boot.__string_rec(this,''); };
nape = {};
nape.callbacks = {};
nape.constraint = {};
nape.dynamics = {};
nape.geom = {};
nape.phys = {};
nape.shape = {};
nape.space = {};
nape.util = {};
zpp_nape = {};
zpp_nape.callbacks = {};
zpp_nape.constraint = {};
zpp_nape.dynamics = {};
zpp_nape.geom = {};
zpp_nape.phys = {};
zpp_nape.shape = {};
zpp_nape.space = {};
zpp_nape.util = {};
function $bind(o,m) { var f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; return f; };;
Reflect = function() { };
Reflect.__name__ = ["Reflect"];
Reflect.field = function(o,field) {
try {
return o[field];
} catch( e ) {
return null;
}
};
Reflect.fields = function(o) {
var a = [];
if(o != null) {
var hasOwnProperty = Object.prototype.hasOwnProperty;
for( var f in o ) {
if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) {
a.push(f);
}
}
}
return a;
};
Reflect.copy = function(o) {
var o2 = { };
var _g = 0;
var _g1 = Reflect.fields(o);
while(_g < _g1.length) {
var f = _g1[_g];
++_g;
o2[f] = Reflect.field(o,f);
}
return o2;
};
Reflect.prototype.__class__ = Reflect;
Std = function() { };
Std.__name__ = ["Std"];
Std.string = function(s) {
return js.Boot.__string_rec(s,"");
};
Std.prototype.__class__ = Std;
StringTools = function() { };
StringTools.__name__ = ["StringTools"];
StringTools.hex = function(n,digits) {
var s = "";
while(true) {
s = "0123456789ABCDEF".charAt(n & 15) + s;
n >>>= 4;
if(!(n > 0)) {
break;
}
}
if(digits != null) {
while(s.length < digits) s = "0" + s;
}
return s;
};
StringTools.prototype.__class__ = StringTools;
if(typeof js=='undefined') js = {};
if(!js._Boot) js._Boot = {};
js._Boot.HaxeError = function(val) {
Error.call(this);
this.val = val;
this.message = String(val);
if(Error.captureStackTrace) {
Error.captureStackTrace(this,js._Boot.HaxeError);
}
};
js._Boot.HaxeError.__name__ = ["js","_Boot","HaxeError"];
js._Boot.HaxeError.__super__ = Error;
// for(var k in Error.prototype ) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
js._Boot.HaxeError.prototype = Object.create(Error.prototype);
js._Boot.HaxeError.wrap = function(val) {
if((val instanceof Error)) {
return val;
} else {
return new js._Boot.HaxeError(val);
}
};
js._Boot.HaxeError.prototype.val = null;
js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
js.Boot = function() { };
js.Boot.__name__ = ["js","Boot"];
js.Boot.getClass = function(o) {
if((o instanceof Array) && o.__enum__ == null) {
return Array;
} else {
var cl = o.__class__;
if(cl != null) {
return cl;
}
var name = js.Boot.__nativeClassName(o);
if(name != null) {
return js.Boot.__resolveNativeClass(name);
}
return null;
}
};
js.Boot.__string_rec = function(o,s) {
if(o == null) {
return "null";
}
if(s.length >= 5) {
return "<...>";
}
var t = typeof(o);
if(t == "function" && (o.__name__ || o.__ename__)) {
t = "object";
}
switch(t) {
case "function":
return "<function>";
case "object":
if(o instanceof Array) {
if(o.__enum__) {
if(o.length == 2) {
return o[0];
}
var str = o[0] + "(";
s += "\t";
var _g1 = 2;
var _g = o.length;
while(_g1 < _g) {
var i = _g1++;
if(i != 2) {
str += "," + js.Boot.__string_rec(o[i],s);
} else {
str += js.Boot.__string_rec(o[i],s);
}
}
return str + ")";
}
var l = o.length;
var i1;
var str1 = "[";
s += "\t";
var _g11 = 0;
var _g2 = l;
while(_g11 < _g2) {
var i2 = _g11++;
str1 += (i2 > 0?",":"") + js.Boot.__string_rec(o[i2],s);
}
str1 += "]";
return str1;
}
var tostr;
try {
tostr = o.toString;
} catch( e ) {
return "???";
}
if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
var s2 = o.toString();
if(s2 != "[object Object]") {
return s2;
}
}
var k = null;
var str2 = "{\n";
s += "\t";
var hasp = o.hasOwnProperty != null;
for( var k in o ) {
if(hasp && !o.hasOwnProperty(k)) {
continue;
}
if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
continue;
}
if(str2.length != 2) {
str2 += ", \n";
}
str2 += s + k + " : " + js.Boot.__string_rec(o[k],s);
}
s = s.substring(1);
str2 += "\n" + s + "}";
return str2;
case "string":
return o;
default:
return String(o);
}
};
js.Boot.__interfLoop = function(cc,cl) {
if(cc == null) {
return false;
}
if(cc == cl) {
return true;
}
var intf = cc.__interfaces__;
if(intf != null) {
var _g1 = 0;
var _g = intf.length;
while(_g1 < _g) {
var i = intf[_g1++];
if(i == cl || js.Boot.__interfLoop(i,cl)) {
return true;
}
}
}
return js.Boot.__interfLoop(cc.__super__,cl);
};
js.Boot.__instanceof = function(o,cl) {
if(cl == null) {
return false;
}
switch(cl) {
case Array:
if((o instanceof Array)) {
return o.__enum__ == null;
} else {
return false;
}
break;
case Bool:
return typeof(o) == "boolean";
case Dynamic:
return true;
case Float:
return typeof(o) == "number";
case Int:
if(typeof(o) == "number") {
return (o|0) === o;
} else {
return false;
}
break;
case String:
return typeof(o) == "string";
default:
if(o != null) {
if(typeof(cl) == "function") {
if(o instanceof cl) {
return true;
}
if(js.Boot.__interfLoop(js.Boot.getClass(o),cl)) {
return true;
}
} else if(typeof(cl) == "object" && js.Boot.__isNativeObj(cl)) {
if(o instanceof cl) {
return true;
}
}
} else {
return false;
}
if(cl == Class && o.__name__ != null) {
return true;
}
if(cl == Enum && o.__ename__ != null) {
return true;
}
return o.__enum__ == cl;
}
};
js.Boot.__nativeClassName = function(o) {
var name = js.Boot.__toStr.call(o).slice(8,-1);
if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
return null;
}
return name;
};
js.Boot.__isNativeObj = function(o) {
return js.Boot.__nativeClassName(o) != null;
};
js.Boot.__resolveNativeClass = function(name) {
return $global[name];
};
js.Boot.prototype.__class__ = js.Boot;
var Config = nape.Config = function() {
};
Config.__name__ = ["nape","Config"];
Config.prototype.__class__ = Config;
var Callback = nape.callbacks.Callback = function() {
this.zpp_inner = null;
if(!ZPP_Callback.internal) {
throw new js._Boot.HaxeError("Error: Callback cannot be instantiated derp!");
}
};
Callback.__name__ = ["nape","callbacks","Callback"];
Callback.prototype.zpp_inner = null;
Callback.prototype.get_event = function() {
return ZPP_Listener.events[this.zpp_inner.event];
};
Callback.prototype.get_listener = function() {
return this.zpp_inner.listener.outer;
};
Callback.prototype.toString = function() {
return "";
};
Callback.prototype.__class__ = Callback;
var BodyCallback = nape.callbacks.BodyCallback = function() {
Callback.call(this);
};
BodyCallback.__name__ = ["nape","callbacks","BodyCallback"];
BodyCallback.__super__ = Callback;
// for(var k in Callback.prototype ) BodyCallback.prototype[k] = Callback.prototype[k];
BodyCallback.prototype = Object.create(Callback.prototype);
BodyCallback.prototype.get_body = function() {
return this.zpp_inner.body.outer;
};
BodyCallback.prototype.toString = function() {
var ret = "Cb:";
ret = "Cb:" + ["WAKE","SLEEP"][this.zpp_inner.event - 2];
ret += ":" + this.zpp_inner.body.outer.toString();
ret += " : listener: " + Std.string(this.zpp_inner.listener.outer);
return ret;
};
BodyCallback.prototype.__class__ = BodyCallback;
var Listener = nape.callbacks.Listener = function() {
this.zpp_inner = null;
if(!ZPP_Listener.internal) {
//throw new js._Boot.HaxeError("Error: Cannot instantiate Listener derp!");
}
};
Listener.__name__ = ["nape","callbacks","Listener"];
Listener.prototype.zpp_inner = null;
Listener.prototype.get_type = function() {
return ZPP_Listener.types[this.zpp_inner.type];
};
Listener.prototype.get_event = function() {
return ZPP_Listener.events[this.zpp_inner.event];
};
Listener.prototype.set_event = function(event) {
if(event == null) {
throw new js._Boot.HaxeError("Error: Cannot set listener event type to null");
}
if(ZPP_Listener.events[this.zpp_inner.event] != event) {
var xevent;
if(ZPP_Flags.CbEvent_BEGIN == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BEGIN = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_BEGIN) {
xevent = 0;
} else {
if(ZPP_Flags.CbEvent_ONGOING == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_ONGOING = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_ONGOING) {
xevent = 6;
} else {
if(ZPP_Flags.CbEvent_END == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_END = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_END) {
xevent = 1;
} else {
if(ZPP_Flags.CbEvent_SLEEP == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_SLEEP = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_SLEEP) {
xevent = 3;
} else {
if(ZPP_Flags.CbEvent_WAKE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_WAKE = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_WAKE) {
xevent = 2;
} else {
if(ZPP_Flags.CbEvent_PRE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_PRE = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_PRE) {
xevent = 5;
} else {
xevent = 4;
}
}
}
}
}
}
this.zpp_inner.swapEvent(xevent);
}
return ZPP_Listener.events[this.zpp_inner.event];
};
Listener.prototype.get_precedence = function() {
return this.zpp_inner.precedence;
};
Listener.prototype.set_precedence = function(precedence) {
if(this.zpp_inner.precedence != precedence) {
this.zpp_inner.precedence = precedence;
this.zpp_inner.invalidate_precedence();
}
return this.zpp_inner.precedence;
};
Listener.prototype.get_space = function() {
if(this.zpp_inner.space == null) {
return null;
} else {
return this.zpp_inner.space.outer;
}
};
Listener.prototype.set_space = function(space) {
if((this.zpp_inner.space == null?null:this.zpp_inner.space.outer) != space) {
if(this.zpp_inner.space != null) {
this.zpp_inner.space.outer.zpp_inner.wrap_listeners.remove(this);
}
if(space != null) {
var _this = space.zpp_inner.wrap_listeners;
if(_this.zpp_inner.reverse_flag) {
_this.push(this);
} else {
_this.unshift(this);
}
} else {
this.zpp_inner.space = null;
}
}
if(this.zpp_inner.space == null) {
return null;
} else {
return this.zpp_inner.space.outer;
}
};
Listener.prototype.toString = function() {
var event = ["BEGIN","END","WAKE","SLEEP","BREAK","PRE","ONGOING"][this.zpp_inner.event];
if(this.zpp_inner.type == 0) {
return "BodyListener{" + event + "::" + Std.string(this.zpp_inner.body.outer_zn.zpp_inner_zn.options.outer) + "}";
} else if(this.zpp_inner.type == 1) {
return "ConstraintListener{" + event + "::" + Std.string(this.zpp_inner.constraint.outer_zn.zpp_inner_zn.options.outer) + "}";
} else {
var con = this.zpp_inner.interaction;
var itype;
switch(con.itype) {
case 1:
itype = "COLLISION";
break;
case 2:
itype = "SENSOR";
break;
case 4:
itype = "FLUID";
break;
default:
itype = "ALL";
}
return (this.zpp_inner.type == 2?"InteractionListener{" + event + "#" + itype + "::" + Std.string(con.outer_zni.zpp_inner_zn.options1.outer) + ":" + Std.string(con.outer_zni.zpp_inner_zn.options2.outer) + "}":"PreListener{" + itype + "::" + Std.string(con.outer_znp.zpp_inner_zn.options1.outer) + ":" + Std.string(con.outer_znp.zpp_inner_zn.options2.outer) + "}") + " precedence=" + this.zpp_inner.precedence;
}
};
Listener.prototype.__class__ = Listener;
var BodyListener = nape.callbacks.BodyListener = function(event,options,handler,precedence) {
if(precedence == null) {
precedence = 0;
}
this.zpp_inner_zn = null;
ZPP_Listener.internal = true;
Listener.call(this);
ZPP_Listener.internal = false;
if(handler == null) {
throw new js._Boot.HaxeError("Error: BodyListener::handler cannot be null");
}
var xevent = -1;
if(ZPP_Flags.CbEvent_WAKE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_WAKE = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_WAKE) {
xevent = 2;
} else {
if(ZPP_Flags.CbEvent_SLEEP == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_SLEEP = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_SLEEP) {
xevent = 3;
} else {
throw new js._Boot.HaxeError("Error: cbEvent '" + event.toString() + "' is not a valid event type for a BodyListener");
}
}
this.zpp_inner_zn = new ZPP_BodyListener(ZPP_OptionType.argument(options),xevent,handler);
this.zpp_inner = this.zpp_inner_zn;
this.zpp_inner.outer = this;
this.zpp_inner_zn.outer_zn = this;
this.zpp_inner.precedence = precedence;
};
BodyListener.__name__ = ["nape","callbacks","BodyListener"];
BodyListener.__super__ = Listener;
// for(var k in Listener.prototype ) BodyListener.prototype[k] = Listener.prototype[k];
BodyListener.prototype = Object.create(Listener.prototype);
BodyListener.prototype.zpp_inner_zn = null;
BodyListener.prototype.get_options = function() {
return this.zpp_inner_zn.options.outer;
};
BodyListener.prototype.set_options = function(options) {
this.zpp_inner_zn.options.set(options.zpp_inner);
return this.zpp_inner_zn.options.outer;
};
BodyListener.prototype.get_handler = function() {
return this.zpp_inner_zn.handler;
};
BodyListener.prototype.set_handler = function(handler) {
if(handler == null) {
throw new js._Boot.HaxeError("Error: BodyListener::handler cannot be null");
}
this.zpp_inner_zn.handler = handler;
return this.zpp_inner_zn.handler;
};
BodyListener.prototype.__class__ = BodyListener;
var CbEvent = nape.callbacks.CbEvent = function() {
if(!ZPP_Flags.internal) {
//throw new js._Boot.HaxeError("Error: Cannot instantiate " + "CbEvent" + " derp!");
}
};
CbEvent.__name__ = ["nape","callbacks","CbEvent"];
CbEvent.BEGIN = null;
CbEvent.get_BEGIN = function() {
if(ZPP_Flags.CbEvent_BEGIN == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BEGIN = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_BEGIN;
};
CbEvent.ONGOING = null;
CbEvent.get_ONGOING = function() {
if(ZPP_Flags.CbEvent_ONGOING == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_ONGOING = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_ONGOING;
};
CbEvent.END = null;
CbEvent.get_END = function() {
if(ZPP_Flags.CbEvent_END == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_END = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_END;
};
CbEvent.WAKE = null;
CbEvent.get_WAKE = function() {
if(ZPP_Flags.CbEvent_WAKE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_WAKE = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_WAKE;
};
CbEvent.SLEEP = null;
CbEvent.get_SLEEP = function() {
if(ZPP_Flags.CbEvent_SLEEP == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_SLEEP = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_SLEEP;
};
CbEvent.BREAK = null;
CbEvent.get_BREAK = function() {
if(ZPP_Flags.CbEvent_BREAK == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BREAK = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_BREAK;
};
CbEvent.PRE = null;
CbEvent.get_PRE = function() {
if(ZPP_Flags.CbEvent_PRE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_PRE = new CbEvent();
ZPP_Flags.internal = false;
}
return ZPP_Flags.CbEvent_PRE;
};
CbEvent.prototype.toString = function() {
if(ZPP_Flags.CbEvent_PRE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_PRE = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_PRE) {
return "PRE";
} else {
if(ZPP_Flags.CbEvent_BEGIN == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BEGIN = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_BEGIN) {
return "BEGIN";
} else {
if(ZPP_Flags.CbEvent_ONGOING == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_ONGOING = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_ONGOING) {
return "ONGOING";
} else {
if(ZPP_Flags.CbEvent_END == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_END = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_END) {
return "END";
} else {
if(ZPP_Flags.CbEvent_WAKE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_WAKE = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_WAKE) {
return "WAKE";
} else {
if(ZPP_Flags.CbEvent_SLEEP == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_SLEEP = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_SLEEP) {
return "SLEEP";
} else {
if(ZPP_Flags.CbEvent_BREAK == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BREAK = new CbEvent();
ZPP_Flags.internal = false;
}
if(this == ZPP_Flags.CbEvent_BREAK) {
return "BREAK";
} else {
return "";
}
}
}
}
}
}
}
};
CbEvent.prototype.__class__ = CbEvent;
var CbType = nape.callbacks.CbType = function() {
this.zpp_inner = null;
this.zpp_inner = new ZPP_CbType();
this.zpp_inner.outer = this;
};
CbType.__name__ = ["nape","callbacks","CbType"];
CbType.ANY_BODY = null;
CbType.get_ANY_BODY = function() {
return ZPP_CbType.ANY_BODY;
};
CbType.ANY_CONSTRAINT = null;
CbType.get_ANY_CONSTRAINT = function() {
return ZPP_CbType.ANY_CONSTRAINT;
};
CbType.ANY_SHAPE = null;
CbType.get_ANY_SHAPE = function() {
return ZPP_CbType.ANY_SHAPE;
};
CbType.ANY_COMPOUND = null;
CbType.get_ANY_COMPOUND = function() {
return ZPP_CbType.ANY_COMPOUND;
};
CbType.prototype.zpp_inner = null;
CbType.prototype.get_id = function() {
return this.zpp_inner.id;
};
CbType.prototype.including = function(includes) {
return new OptionType(this).including(includes);
};
CbType.prototype.excluding = function(excludes) {
return new OptionType(this).excluding(excludes);
};
CbType.prototype.get_userData = function() {
if(this.zpp_inner.userData == null) {
this.zpp_inner.userData = { };
}
return this.zpp_inner.userData;
};
CbType.prototype.get_interactors = function() {
if(this.zpp_inner.wrap_interactors == null) {
this.zpp_inner.wrap_interactors = ZPP_InteractorList.get(this.zpp_inner.interactors,true);
}
return this.zpp_inner.wrap_interactors;
};
CbType.prototype.get_constraints = function() {
if(this.zpp_inner.wrap_constraints == null) {
this.zpp_inner.wrap_constraints = ZPP_ConstraintList.get(this.zpp_inner.constraints,true);
}
return this.zpp_inner.wrap_constraints;
};
CbType.prototype.toString = function() {
if(this == ZPP_CbType.ANY_BODY) {
return "ANY_BODY";
} else if(this == ZPP_CbType.ANY_SHAPE) {
return "ANY_SHAPE";
} else if(this == ZPP_CbType.ANY_COMPOUND) {
return "ANY_COMPOUND";
} else if(this == ZPP_CbType.ANY_CONSTRAINT) {
return "ANY_CONSTRAINT";
} else {
return "CbType#" + this.zpp_inner.id;
}
};
CbType.prototype.__class__ = CbType;
var CbTypeIterator = nape.callbacks.CbTypeIterator = function() {
this.zpp_next = null;
this.zpp_critical = false;
this.zpp_i = 0;
this.zpp_inner = null;
if(!ZPP_CbTypeList.internal) {
//throw new js._Boot.HaxeError("Error: Cannot instantiate " + "CbType" + "Iterator derp!");
}
};
CbTypeIterator.__name__ = ["nape","callbacks","CbTypeIterator"];
CbTypeIterator.get = function(list) {
var ret;
if(CbTypeIterator.zpp_pool == null) {
ZPP_CbTypeList.internal = true;
var ret1 = new CbTypeIterator();
ZPP_CbTypeList.internal = false;
ret = ret1;
} else {
var r = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = r.zpp_next;
ret = r;
}
ret.zpp_i = 0;
ret.zpp_inner = list;
ret.zpp_critical = false;
return ret;
};
CbTypeIterator.prototype.zpp_inner = null;
CbTypeIterator.prototype.zpp_i = null;
CbTypeIterator.prototype.zpp_critical = null;
CbTypeIterator.prototype.zpp_next = null;
CbTypeIterator.prototype.hasNext = function() {
this.zpp_inner.zpp_inner.valmod();
var _this = this.zpp_inner;
_this.zpp_inner.valmod();
if(_this.zpp_inner.zip_length) {
_this.zpp_inner.zip_length = false;
_this.zpp_inner.user_length = _this.zpp_inner.inner.length;
}
var length = _this.zpp_inner.user_length;
this.zpp_critical = true;
if(this.zpp_i < length) {
return true;
} else {
this.zpp_next = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = this;
this.zpp_inner = null;
return false;
}
};
CbTypeIterator.prototype.next = function() {
this.zpp_critical = false;
return this.zpp_inner.at(this.zpp_i++);
};
CbTypeIterator.prototype.__class__ = CbTypeIterator;
var CbTypeList = nape.callbacks.CbTypeList = function() {
this.zpp_inner = null;
this.zpp_inner = new ZPP_CbTypeList();
this.zpp_inner.outer = this;
};
CbTypeList.__name__ = ["nape","callbacks","CbTypeList"];
CbTypeList.fromArray = function(array) {
if(array == null) {
throw new js._Boot.HaxeError("Error: Cannot convert null Array to Nape list");
}
var ret = new CbTypeList();
var _g = 0;
while(_g < array.length) {
var i = array[_g];
++_g;
ret.push(i);
}
return ret;
};
CbTypeList.prototype.zpp_inner = null;
CbTypeList.prototype.get_length = function() {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
return this.zpp_inner.user_length;
};
CbTypeList.prototype.has = function(obj) {
this.zpp_inner.valmod();
return this.zpp_inner.inner.has(obj.zpp_inner);
};
CbTypeList.prototype.at = function(index) {
this.zpp_inner.valmod();
var tmp;
if(index >= 0) {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
tmp = index >= this.zpp_inner.user_length;
} else {
tmp = true;
}
if(tmp) {
throw new js._Boot.HaxeError("Error: Index out of bounds");
}
if(this.zpp_inner.reverse_flag) {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
index = this.zpp_inner.user_length - 1 - index;
}
if(index < this.zpp_inner.at_index || this.zpp_inner.at_ite == null) {
this.zpp_inner.at_index = index;
this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(index);
} else {
while(this.zpp_inner.at_index != index) {
this.zpp_inner.at_index++;
this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
}
}
return this.zpp_inner.at_ite.elt.outer;
};
CbTypeList.prototype.push = function(obj) {
if(this.zpp_inner.immutable) {
throw new js._Boot.HaxeError("Error: " + "CbType" + "List is immutable");
}
this.zpp_inner.modify_test();
this.zpp_inner.valmod();
var cont = this.zpp_inner.adder != null?this.zpp_inner.adder(obj):true;
if(cont) {
if(this.zpp_inner.reverse_flag) {
this.zpp_inner.inner.add(obj.zpp_inner);
} else {
if(this.zpp_inner.push_ite == null) {
var tmp;
if(this.zpp_inner.inner.head == null) {
tmp = null;
} else {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
tmp = this.zpp_inner.inner.iterator_at(this.zpp_inner.user_length - 1);
}
this.zpp_inner.push_ite = tmp;
}
this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite,obj.zpp_inner);
}
this.zpp_inner.invalidate();
if(this.zpp_inner.post_adder != null) {
this.zpp_inner.post_adder(obj);
}
}
return cont;
};
CbTypeList.prototype.unshift = function(obj) {
if(this.zpp_inner.immutable) {
throw new js._Boot.HaxeError("Error: " + "CbType" + "List is immutable");
}
this.zpp_inner.modify_test();
this.zpp_inner.valmod();
var cont = this.zpp_inner.adder != null?this.zpp_inner.adder(obj):true;
if(cont) {
if(this.zpp_inner.reverse_flag) {
if(this.zpp_inner.push_ite == null) {
var tmp;
if(this.zpp_inner.inner.head == null) {
tmp = null;
} else {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
tmp = this.zpp_inner.inner.iterator_at(this.zpp_inner.user_length - 1);
}
this.zpp_inner.push_ite = tmp;
}
this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite,obj.zpp_inner);
} else {
this.zpp_inner.inner.add(obj.zpp_inner);
}
this.zpp_inner.invalidate();
if(this.zpp_inner.post_adder != null) {
this.zpp_inner.post_adder(obj);
}
}
return cont;
};
CbTypeList.prototype.pop = function() {
if(this.zpp_inner.immutable) {
throw new js._Boot.HaxeError("Error: " + "CbType" + "List is immutable");
}
this.zpp_inner.modify_test();
if(this.zpp_inner.inner.head == null) {
throw new js._Boot.HaxeError("Error: Cannot remove from empty list");
}
this.zpp_inner.valmod();
var ret = null;
if(this.zpp_inner.reverse_flag) {
ret = this.zpp_inner.inner.head.elt;
var retx = ret.outer;
if(this.zpp_inner.subber != null) {
this.zpp_inner.subber(retx);
}
if(!this.zpp_inner.dontremove) {
this.zpp_inner.inner.pop();
}
} else {
if(this.zpp_inner.at_ite != null && this.zpp_inner.at_ite.next == null) {
this.zpp_inner.at_ite = null;
}
var ite;
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
if(this.zpp_inner.user_length == 1) {
ite = null;
} else {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
ite = this.zpp_inner.inner.iterator_at(this.zpp_inner.user_length - 2);
}
if(ite == null) {
ret = this.zpp_inner.inner.head.elt;
} else {
ret = ite.next.elt;
}
var retx1 = ret.outer;
if(this.zpp_inner.subber != null) {
this.zpp_inner.subber(retx1);
}
if(!this.zpp_inner.dontremove) {
this.zpp_inner.inner.erase(ite);
}
}
this.zpp_inner.invalidate();
return ret.outer;
};
CbTypeList.prototype.shift = function() {
if(this.zpp_inner.immutable) {
throw new js._Boot.HaxeError("Error: " + "CbType" + "List is immutable");
}
this.zpp_inner.modify_test();
if(this.zpp_inner.inner.head == null) {
throw new js._Boot.HaxeError("Error: Cannot remove from empty list");
}
this.zpp_inner.valmod();
var ret = null;
if(this.zpp_inner.reverse_flag) {
if(this.zpp_inner.at_ite != null && this.zpp_inner.at_ite.next == null) {
this.zpp_inner.at_ite = null;
}
var ite;
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
if(this.zpp_inner.user_length == 1) {
ite = null;
} else {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
ite = this.zpp_inner.inner.iterator_at(this.zpp_inner.user_length - 2);
}
if(ite == null) {
ret = this.zpp_inner.inner.head.elt;
} else {
ret = ite.next.elt;
}
var retx = ret.outer;
if(this.zpp_inner.subber != null) {
this.zpp_inner.subber(retx);
}
if(!this.zpp_inner.dontremove) {
this.zpp_inner.inner.erase(ite);
}
} else {
ret = this.zpp_inner.inner.head.elt;
var retx1 = ret.outer;
if(this.zpp_inner.subber != null) {
this.zpp_inner.subber(retx1);
}
if(!this.zpp_inner.dontremove) {
this.zpp_inner.inner.pop();
}
}
this.zpp_inner.invalidate();
return ret.outer;
};
CbTypeList.prototype.add = function(obj) {
if(this.zpp_inner.reverse_flag) {
return this.push(obj);
} else {
return this.unshift(obj);
}
};
CbTypeList.prototype.remove = function(obj) {
if(this.zpp_inner.immutable) {
throw new js._Boot.HaxeError("Error: " + "CbType" + "List is immutable");
}
this.zpp_inner.modify_test();
this.zpp_inner.valmod();
var ret;
ret = false;
var cx_ite = this.zpp_inner.inner.head;
while(cx_ite != null) {
if(cx_ite.elt == obj.zpp_inner) {
ret = true;
break;
}
cx_ite = cx_ite.next;
}
if(ret) {
if(this.zpp_inner.subber != null) {
this.zpp_inner.subber(obj);
}
if(!this.zpp_inner.dontremove) {
this.zpp_inner.inner.remove(obj.zpp_inner);
}
this.zpp_inner.invalidate();
}
return ret;
};
CbTypeList.prototype.clear = function() {
if(this.zpp_inner.immutable) {
throw new js._Boot.HaxeError("Error: " + "CbType" + "List is immutable");
}
if(this.zpp_inner.reverse_flag) {
while(this.zpp_inner.inner.head != null) this.pop();
} else {
while(this.zpp_inner.inner.head != null) this.shift();
}
};
CbTypeList.prototype.empty = function() {
return this.zpp_inner.inner.head == null;
};
CbTypeList.prototype.iterator = function() {
this.zpp_inner.valmod();
return CbTypeIterator.get(this);
};
CbTypeList.prototype.copy = function(deep) {
if(deep == null) {
deep = false;
}
var ret = new CbTypeList();
this.zpp_inner.valmod();
var _g = CbTypeIterator.get(this);
while(true) {
_g.zpp_inner.zpp_inner.valmod();
var _this = _g.zpp_inner;
_this.zpp_inner.valmod();
if(_this.zpp_inner.zip_length) {
_this.zpp_inner.zip_length = false;
_this.zpp_inner.user_length = _this.zpp_inner.inner.length;
}
var length = _this.zpp_inner.user_length;
_g.zpp_critical = true;
var tmp;
if(_g.zpp_i < length) {
tmp = true;
} else {
_g.zpp_next = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = _g;
_g.zpp_inner = null;
tmp = false;
}
if(!tmp) {
break;
}
_g.zpp_critical = false;
var i = _g.zpp_inner.at(_g.zpp_i++);
if(deep) {
throw new js._Boot.HaxeError("Error: " + "CbType" + " is not a copyable type");
}
ret.push(i);
}
return ret;
};
CbTypeList.prototype.merge = function(xs) {
if(xs == null) {
throw new js._Boot.HaxeError("Error: Cannot merge with null list");
}
xs.zpp_inner.valmod();
var _g = CbTypeIterator.get(xs);
while(true) {
_g.zpp_inner.zpp_inner.valmod();
var _this = _g.zpp_inner;
_this.zpp_inner.valmod();
if(_this.zpp_inner.zip_length) {
_this.zpp_inner.zip_length = false;
_this.zpp_inner.user_length = _this.zpp_inner.inner.length;
}
var length = _this.zpp_inner.user_length;
_g.zpp_critical = true;
var tmp;
if(_g.zpp_i < length) {
tmp = true;
} else {
_g.zpp_next = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = _g;
_g.zpp_inner = null;
tmp = false;
}
if(!tmp) {
break;
}
_g.zpp_critical = false;
var x = _g.zpp_inner.at(_g.zpp_i++);
if(!this.has(x)) {
if(this.zpp_inner.reverse_flag) {
this.push(x);
} else {
this.unshift(x);
}
}
}
};
CbTypeList.prototype.toString = function() {
var ret = "[";
var fst = true;
this.zpp_inner.valmod();
var _g = CbTypeIterator.get(this);
while(true) {
_g.zpp_inner.zpp_inner.valmod();
var _this = _g.zpp_inner;
_this.zpp_inner.valmod();
if(_this.zpp_inner.zip_length) {
_this.zpp_inner.zip_length = false;
_this.zpp_inner.user_length = _this.zpp_inner.inner.length;
}
var length = _this.zpp_inner.user_length;
_g.zpp_critical = true;
var tmp;
if(_g.zpp_i < length) {
tmp = true;
} else {
_g.zpp_next = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = _g;
_g.zpp_inner = null;
tmp = false;
}
if(!tmp) {
break;
}
_g.zpp_critical = false;
var i = _g.zpp_inner.at(_g.zpp_i++);
if(!fst) {
ret += ",";
}
ret += i == null?"NULL":i.toString();
fst = false;
}
return ret + "]";
};
CbTypeList.prototype.foreach = function(lambda) {
if(lambda == null) {
throw new js._Boot.HaxeError("Error: Cannot execute null on list elements");
}
this.zpp_inner.valmod();
var it = CbTypeIterator.get(this);
while(true) {
it.zpp_inner.zpp_inner.valmod();
var _this = it.zpp_inner;
_this.zpp_inner.valmod();
if(_this.zpp_inner.zip_length) {
_this.zpp_inner.zip_length = false;
_this.zpp_inner.user_length = _this.zpp_inner.inner.length;
}
var length = _this.zpp_inner.user_length;
it.zpp_critical = true;
var tmp;
if(it.zpp_i < length) {
tmp = true;
} else {
it.zpp_next = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = it;
it.zpp_inner = null;
tmp = false;
}
if(!tmp) {
break;
}
try {
it.zpp_critical = false;
lambda(it.zpp_inner.at(it.zpp_i++));
} catch( e ) {
it.zpp_next = CbTypeIterator.zpp_pool;
CbTypeIterator.zpp_pool = it;
it.zpp_inner = null;
break;
}
}
return this;
};
CbTypeList.prototype.filter = function(lambda) {
if(lambda == null) {
throw new js._Boot.HaxeError("Error: Cannot select elements of list with null");
}
var i = 0;
while(true) {
this.zpp_inner.valmod();
if(this.zpp_inner.zip_length) {
this.zpp_inner.zip_length = false;
this.zpp_inner.user_length = this.zpp_inner.inner.length;
}
if(!(i < this.zpp_inner.user_length)) {
break;
}
var x = this.at(i);
try {
if(lambda(x)) {
++i;
} else {
this.remove(x);
}
} catch( e ) {
break;
}
}
return this;
};
CbTypeList.prototype.__class__ = CbTypeList;
var ConstraintCallback = nape.callbacks.ConstraintCallback = function() {
Callback.call(this);
};
ConstraintCallback.__name__ = ["nape","callbacks","ConstraintCallback"];
ConstraintCallback.__super__ = Callback;
// for(var k in Callback.prototype ) ConstraintCallback.prototype[k] = Callback.prototype[k];
ConstraintCallback.prototype = Object.create(Callback.prototype);
ConstraintCallback.prototype.get_constraint = function() {
return this.zpp_inner.constraint.outer;
};
ConstraintCallback.prototype.toString = function() {
var ret = "Cb:";
ret = "Cb:" + ["WAKE","SLEEP","BREAK"][this.zpp_inner.event - 2];
ret += ":" + this.zpp_inner.constraint.outer.toString();
ret += " : listener: " + Std.string(this.zpp_inner.listener.outer);
return ret;
};
ConstraintCallback.prototype.__class__ = ConstraintCallback;
var ConstraintListener = nape.callbacks.ConstraintListener = function(event,options,handler,precedence) {
if(precedence == null) {
precedence = 0;
}
this.zpp_inner_zn = null;
ZPP_Listener.internal = true;
Listener.call(this);
ZPP_Listener.internal = false;
if(handler == null) {
throw new js._Boot.HaxeError("Error: ConstraintListener::handler cannot be null");
}
var xevent = -1;
if(ZPP_Flags.CbEvent_WAKE == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_WAKE = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_WAKE) {
xevent = 2;
} else {
if(ZPP_Flags.CbEvent_SLEEP == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_SLEEP = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_SLEEP) {
xevent = 3;
} else {
if(ZPP_Flags.CbEvent_BREAK == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BREAK = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_BREAK) {
xevent = 4;
} else {
throw new js._Boot.HaxeError("Error: cbEvent '" + event.toString() + "' is not a valid event type for a ConstraintListener");
}
}
}
this.zpp_inner_zn = new ZPP_ConstraintListener(ZPP_OptionType.argument(options),xevent,handler);
this.zpp_inner = this.zpp_inner_zn;
this.zpp_inner.outer = this;
this.zpp_inner_zn.outer_zn = this;
this.zpp_inner.precedence = precedence;
};
ConstraintListener.__name__ = ["nape","callbacks","ConstraintListener"];
ConstraintListener.__super__ = Listener;
// for(var k in Listener.prototype ) ConstraintListener.prototype[k] = Listener.prototype[k];
ConstraintListener.prototype = Object.create(Listener.prototype);
ConstraintListener.prototype.zpp_inner_zn = null;
ConstraintListener.prototype.get_options = function() {
return this.zpp_inner_zn.options.outer;
};
ConstraintListener.prototype.set_options = function(options) {
this.zpp_inner_zn.options.set(options.zpp_inner);
return this.zpp_inner_zn.options.outer;
};
ConstraintListener.prototype.get_handler = function() {
return this.zpp_inner_zn.handler;
};
ConstraintListener.prototype.set_handler = function(handler) {
if(handler == null) {
throw new js._Boot.HaxeError("Error: ConstraintListener::handler cannot be null");
}
this.zpp_inner_zn.handler = handler;
return this.zpp_inner_zn.handler;
};
ConstraintListener.prototype.__class__ = ConstraintListener;
var InteractionCallback = nape.callbacks.InteractionCallback = function() {
Callback.call(this);
};
InteractionCallback.__name__ = ["nape","callbacks","InteractionCallback"];
InteractionCallback.__super__ = Callback;
// for(var k in Callback.prototype ) InteractionCallback.prototype[k] = Callback.prototype[k];
InteractionCallback.prototype = Object.create(Callback.prototype);
InteractionCallback.prototype.get_int1 = function() {
return this.zpp_inner.int1.outer_i;
};
InteractionCallback.prototype.get_int2 = function() {
return this.zpp_inner.int2.outer_i;
};
InteractionCallback.prototype.get_arbiters = function() {
return this.zpp_inner.wrap_arbiters;
};
InteractionCallback.prototype.toString = function() {
var ret = "Cb:";
ret = "Cb:" + ["BEGIN","END","","","","","ONGOING"][this.zpp_inner.event];
ret += ":" + this.zpp_inner.int1.outer_i.toString() + "/" + this.zpp_inner.int2.outer_i.toString();
ret += " : " + this.zpp_inner.wrap_arbiters.toString();
ret += " : listener: " + Std.string(this.zpp_inner.listener.outer);
return ret;
};
InteractionCallback.prototype.__class__ = InteractionCallback;
var InteractionListener = nape.callbacks.InteractionListener = function(event,interactionType,options1,options2,handler,precedence) {
if(precedence == null) {
precedence = 0;
}
this.zpp_inner_zn = null;
ZPP_Listener.internal = true;
Listener.call(this);
ZPP_Listener.internal = false;
if(handler == null) {
throw new js._Boot.HaxeError("Error: InteractionListener::handler cannot be null");
}
if(event == null) {
throw new js._Boot.HaxeError("Error: CbEvent cannot be null for InteractionListener");
}
var xevent = -1;
if(ZPP_Flags.CbEvent_BEGIN == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_BEGIN = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_BEGIN) {
xevent = 0;
} else {
if(ZPP_Flags.CbEvent_END == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_END = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_END) {
xevent = 1;
} else {
if(ZPP_Flags.CbEvent_ONGOING == null) {
ZPP_Flags.internal = true;
ZPP_Flags.CbEvent_ONGOING = new CbEvent();
ZPP_Flags.internal = false;
}
if(event == ZPP_Flags.CbEvent_ONGOING) {
xevent = 6;
} else {
throw new js._Boot.HaxeError("Error: CbEvent '" + event.toString() + "' is not a valid event type for InteractionListener");
}
}
}
this.zpp_inner_zn = new ZPP_InteractionListener(ZPP_OptionType.argument(options1),ZPP_OptionType.argument(options2),xevent,2);
this.zpp_inner = this.zpp_inner_zn;
this.zpp_inner.outer = this;
this.zpp_inner_zn.outer_zni = this;
this.zpp_inner.precedence = precedence;
this.zpp_inner_zn.handleri = handler;
if(interactionType == null) {
throw new js._Boot.HaxeError("Error: Cannot set listener interaction type to null");
}
var ret = this.zpp_inner_zn.itype;
var tmp;
if(ret == 1) {
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_COLLISION;
} else if(ret == 2) {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_SENSOR;
} else if(ret == 4) {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_FLUID;
} else if(ret == 7) {
if(ZPP_Flags.InteractionType_ANY == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_ANY = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_ANY;
} else {
tmp = null;
}
if(tmp != interactionType) {
var xtype;
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
if(interactionType == ZPP_Flags.InteractionType_COLLISION) {
xtype = 1;
} else {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
if(interactionType == ZPP_Flags.InteractionType_SENSOR) {
xtype = 2;
} else {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
if(interactionType == ZPP_Flags.InteractionType_FLUID) {
xtype = 4;
} else {
xtype = 7;
}
}
}
this.zpp_inner_zn.itype = xtype;
}
var ret1 = this.zpp_inner_zn.itype;
if(ret1 == 1) {
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
} else if(ret1 == 2) {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
} else if(ret1 == 4) {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
} else if(ret1 == 7) {
if(ZPP_Flags.InteractionType_ANY == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_ANY = new InteractionType();
ZPP_Flags.internal = false;
}
}
};
InteractionListener.__name__ = ["nape","callbacks","InteractionListener"];
InteractionListener.__super__ = Listener;
// for(var k in Listener.prototype ) InteractionListener.prototype[k] = Listener.prototype[k];
InteractionListener.prototype = Object.create(Listener.prototype);
InteractionListener.prototype.zpp_inner_zn = null;
InteractionListener.prototype.get_options1 = function() {
return this.zpp_inner_zn.options1.outer;
};
InteractionListener.prototype.set_options1 = function(options1) {
this.zpp_inner_zn.options1.set(options1.zpp_inner);
return this.zpp_inner_zn.options1.outer;
};
InteractionListener.prototype.get_options2 = function() {
return this.zpp_inner_zn.options2.outer;
};
InteractionListener.prototype.set_options2 = function(options2) {
this.zpp_inner_zn.options2.set(options2.zpp_inner);
return this.zpp_inner_zn.options2.outer;
};
InteractionListener.prototype.get_interactionType = function() {
var ret = this.zpp_inner_zn.itype;
if(ret == 1) {
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_COLLISION;
} else if(ret == 2) {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_SENSOR;
} else if(ret == 4) {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_FLUID;
} else if(ret == 7) {
if(ZPP_Flags.InteractionType_ANY == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_ANY = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_ANY;
} else {
return null;
}
};
InteractionListener.prototype.set_interactionType = function(interactionType) {
if(interactionType == null) {
throw new js._Boot.HaxeError("Error: Cannot set listener interaction type to null");
}
var ret = this.zpp_inner_zn.itype;
var tmp;
if(ret == 1) {
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_COLLISION;
} else if(ret == 2) {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_SENSOR;
} else if(ret == 4) {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_FLUID;
} else if(ret == 7) {
if(ZPP_Flags.InteractionType_ANY == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_ANY = new InteractionType();
ZPP_Flags.internal = false;
}
tmp = ZPP_Flags.InteractionType_ANY;
} else {
tmp = null;
}
if(tmp != interactionType) {
var xtype;
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
if(interactionType == ZPP_Flags.InteractionType_COLLISION) {
xtype = 1;
} else {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
if(interactionType == ZPP_Flags.InteractionType_SENSOR) {
xtype = 2;
} else {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
if(interactionType == ZPP_Flags.InteractionType_FLUID) {
xtype = 4;
} else {
xtype = 7;
}
}
}
this.zpp_inner_zn.itype = xtype;
}
var ret1 = this.zpp_inner_zn.itype;
if(ret1 == 1) {
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_COLLISION;
} else if(ret1 == 2) {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_SENSOR;
} else if(ret1 == 4) {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_FLUID;
} else if(ret1 == 7) {
if(ZPP_Flags.InteractionType_ANY == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_ANY = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_ANY;
} else {
return null;
}
};
InteractionListener.prototype.get_handler = function() {
return this.zpp_inner_zn.handleri;
};
InteractionListener.prototype.set_handler = function(handler) {
if(handler == null) {
throw new js._Boot.HaxeError("Error: InteractionListener::handler cannot be null");
}
this.zpp_inner_zn.handleri = handler;
return this.zpp_inner_zn.handleri;
};
InteractionListener.prototype.get_allowSleepingCallbacks = function() {
return this.zpp_inner_zn.allowSleepingCallbacks;
};
InteractionListener.prototype.set_allowSleepingCallbacks = function(allowSleepingCallbacks) {
this.zpp_inner_zn.allowSleepingCallbacks = allowSleepingCallbacks;
return this.zpp_inner_zn.allowSleepingCallbacks;
};
InteractionListener.prototype.__class__ = InteractionListener;
var InteractionType = nape.callbacks.InteractionType = function() {
if(!ZPP_Flags.internal) {
//throw new js._Boot.HaxeError("Error: Cannot instantiate " + "InteractionType" + " derp!");
}
};
InteractionType.__name__ = ["nape","callbacks","InteractionType"];
InteractionType.COLLISION = null;
InteractionType.get_COLLISION = function() {
if(ZPP_Flags.InteractionType_COLLISION == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_COLLISION = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_COLLISION;
};
InteractionType.SENSOR = null;
InteractionType.get_SENSOR = function() {
if(ZPP_Flags.InteractionType_SENSOR == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_SENSOR = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_SENSOR;
};
InteractionType.FLUID = null;
InteractionType.get_FLUID = function() {
if(ZPP_Flags.InteractionType_FLUID == null) {
ZPP_Flags.internal = true;
ZPP_Flags.InteractionType_FLUID = new InteractionType();
ZPP_Flags.internal = false;
}
return ZPP_Flags.InteractionType_FLUID;
};
InteractionType.ANY = null;
InteractionType.get_ANY = function() {
if(ZPP_Flags.InteractionType_ANY == null) {
ZPP_Flags.interna