From a111e42d630ae12f512c79db19514e552fc2fe3e Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Wed, 14 Jun 2017 15:30:30 +0200 Subject: [PATCH] unneeded --- src/game-lib-a-api-component.js | 55 +-------------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/src/game-lib-a-api-component.js b/src/game-lib-a-api-component.js index 38398f4..92f5eb8 100644 --- a/src/game-lib-a-api-component.js +++ b/src/game-lib-a-api-component.js @@ -18,57 +18,4 @@ GameLib.API.Component = function( }; GameLib.API.Component.prototype = Object.create(GameLib.Event.prototype); -GameLib.API.Component.prototype.constructor = GameLib.API.Component; - -/** - * Returns an API component from an object component - * @param objectComponent (should be an ID string - components get loaded and linked) - * @returns {GameLib.API.Component} - * @constructor - */ -GameLib.API.Component.FromObject = function(objectComponent) { - if (objectComponent instanceof Object) { - - if (objectComponent.componentType == GameLib.Component.COMPONENT_PATH_FOLLOWING) { - return GameLib.D3.API.PathFollowing.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_RENDERER) { - return GameLib.D3.API.Renderer.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_COMPOSER) { - return GameLib.D3.API.Composer.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_PASS) { - return GameLib.D3.API.Pass.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_LOOK_AT) { - return GameLib.D3.API.LookAt.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_FOLLOW) { - return GameLib.D3.API.Follow.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_RENDER_TARGET) { - return GameLib.D3.API.RenderTarget.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_SPLINE) { - return GameLib.D3.API.Spline.FromObject(objectComponent); - } - - if (objectComponent.componentType === GameLib.Component.COMPONENT_INPUT_DRIVE) { - return GameLib.D3.API.Input.Drive.FromObject(objectComponent); - } - - console.warn('No API Component was associated with this Object'); - throw new Error('No API Component was associated with this Object'); - - } else { - return objectComponent; - } -}; +GameLib.API.Component.prototype.constructor = GameLib.API.Component; \ No newline at end of file