var gdjs;(function(r){class o extends r.RuntimeObject{constructor(t,e){super(t,e);this._radius=e.content.radius>0?e.content.radius:1,this._color=r.rgbOrHexToRGBColor(e.content.color),this._debugMode=e.content.debugMode,this._texture=e.content.texture,this._obstaclesManager=r.LightObstaclesManager.getManager(t),this._renderer=new r.LightRuntimeObjectRenderer(this,t),this._instanceContainer=t,this.onCreated()}static hexToRGBColor(t){const e=parseInt(t.replace("#",""),16);return[e>>16&255,e>>8&255,e&255]}getRendererObject(){return this._renderer.getRendererObject()}updateFromObjectData(t,e){return t.content.radius!==e.content.radius&&this.setRadius(e.content.radius),t.content.color!==e.content.color&&(this._color=r.rgbOrHexToRGBColor(e.content.color),this._renderer.updateColor()),t.content.texture!==e.content.texture&&(this._texture=e.content.texture,this._renderer.updateMesh()),t.content.debugMode!==e.content.debugMode&&(this._debugMode=e.content.debugMode,this._renderer.updateDebugMode()),!0}updatePreRender(){this._renderer.ensureUpToDate()}getRadius(){return this._radius}setRadius(t){this._radius=t>0?t:1,this._renderer.updateRadius()}getHeight(){return 2*this._radius}getWidth(){return 2*this._radius}getDrawableX(){return this.x-this._radius}getDrawableY(){return this.y-this._radius}getColor(){return this._color[0]+";"+this._color[1]+";"+this._color[2]}setColor(t){this._color=r.rgbOrHexToRGBColor(t),this._renderer.updateColor()}getObstaclesManager(){return this._obstaclesManager}getDebugMode(){return this._debugMode}getTexture(){return this._texture}}r.LightRuntimeObject=o,r.registerObject("Lighting::LightObject",r.LightRuntimeObject)})(gdjs||(gdjs={}));
//# sourceMappingURL=lightruntimeobject.js.map
