(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/// <reference path="../../typescript/typescriptAPI/TypeScriptAPIPlugin.d.ts" />
"use strict";

SupCore.system.registerPlugin("typescriptAPI", "Light", {
    code: "namespace Sup {\n  export class Light extends Sup.ActorComponent {\n    type: Light.Type;\n\n    constructor(actor, options) {\n      super(actor);\n      this.__inner = new SupEngine.componentClasses.Light(this.actor.__inner);\n      this.__inner.__outer = this;\n      this.actor.light = this;\n\n      if (options == null) return;\n      this.type = options.type;\n      let types = [\"ambient\", \"point\", \"spot\", \"directional\"];\n      this.__inner.setType(types[this.type]);\n      this.__inner.setColor(options.color.getHex());\n      if (options.intensity != null) this.__inner.setIntensity(options.intensity);\n      if (options.distance != null) this.__inner.setDistance(options.distance);\n      if (options.angle != null) this.__inner.setAngle(options.angle);\n      if (options.target != null) this.__inner.setTarget(options.target.x, options.target.y, options.target.z);\n      if (options.castShadow != null) this.__inner.setCastShadow(options.castShadow);\n    }\n    destroy() {\n      this.actor.light = null;\n      super.destroy();\n    }\n\n    getType() { return this.type; }\n    setColor(color) { this.__inner.setColor(color.getHex()); return this; }\n    getColor() { return new Color(1, 1, 1).setHex(this.__inner.color); }\n    setIntensity(intensity) { this.__inner.setIntensity(intensity); return this; }\n    getIntensity() { return this.__inner.intensity; }\n    setDistance(distance) { this.__inner.setDistance(distance); return this; }\n    getDistance() { return this.__inner.distance; }\n    setAngle(angle) { this.__inner.setAngle(angle); return this; }\n    getAngle() { return this.__inner.angle; }\n    setTarget(target) { this.__inner.setTarget(target.x, target.y, target.z); return this; }\n    getTarget() { return new Math.Vector3(this.__inner.target.x, this.__inner.target.y, this.__inner.target.z); }\n    setCastShadow(castShadow) { this.__inner.setCastShadow(castShadow); return this; }\n    getCastShadow() { return this.__inner.castShadow; }\n  }\n\n  export namespace Light {\n    export enum Type { Ambient, Point, Spot, Directional };\n  }\n}\n",
    defs: "interface LightOptions {\n  type: Sup.Light.Type;\n  color: Sup.Color;\n  intensity?: number;\n  distance?: number;\n  angle?: number;\n  target?: {\n    x: number;\n    y: number;\n    z: number;\n  };\n  castShadow?: boolean;\n}\n\ndeclare namespace Sup {\n  class Light extends Sup.ActorComponent {\n    constructor(actor: Actor, options: LightOptions);\n\n    getType(): Sup.Light.Type;\n    setColor(color: Color): Light;\n    getColor(): Color;\n    setIntensity(intensity: number): Light;\n    getIntensity(): number;\n    setDistance(distance: number): Light;\n    getDistance(): number;\n    setAngle(angle: number): Light;\n    getAngle(): number;\n    setTarget(target: Sup.Math.XYZ): Light;\n    getTarget(): Math.Vector3;\n    setCastShadow(castShadow: boolean): Light;\n    getCastShadow(): boolean;\n  }\n\n  namespace Light {\n    enum Type { Ambient, Point, Spot, Directional }\n  }\n}\n",
    exposeActorComponent: { propertyName: "light", className: "Sup.Light" }
});

},{}]},{},[1]);
