From 51ba9a855d4eb45dbe6d3b2b9b4b1876002c578e Mon Sep 17 00:00:00 2001 From: polygonboutique Date: Thu, 17 Nov 2016 10:24:59 +0100 Subject: [PATCH] merge part 1 / 2 --- src/game-lib-a.js | 6 +++--- src/game-lib-component-colorlerp.js | 10 ++++++++-- ...ame-lib-component-vehicle-ai-object-avoidance.js | 13 ++++++++++--- src/game-lib-component-vehicle-ai-path-boid.js | 13 ++++++++++--- src/game-lib-component-vehicle-ai-path-steering.js | 13 ++++++++++--- 5 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/game-lib-a.js b/src/game-lib-a.js index cacc090..b133e51 100644 --- a/src/game-lib-a.js +++ b/src/game-lib-a.js @@ -17,9 +17,9 @@ if (typeof Q == 'undefined') { if (typeof _ == 'undefined') { if (typeof require == 'undefined') { - console.warn('You need the lowdash library for the GameLib.D3'); - throw new Error('You need the lowdash library for the GameLib.D3'); + console.warn('You need the lodash library for the GameLib.D3'); + throw new Error('You need the lodash library for the GameLib.D3'); } - var _ = require('_'); + var _ = require('lodash'); } \ No newline at end of file diff --git a/src/game-lib-component-colorlerp.js b/src/game-lib-component-colorlerp.js index 57eaad8..5a46a6c 100644 --- a/src/game-lib-component-colorlerp.js +++ b/src/game-lib-component-colorlerp.js @@ -1,10 +1,16 @@ GameLib.D3.ComponentColorLerp = function( - componentId, + id, + name, startColor, endColor, lerpSpeed ) { - this.componentId = componentId || GameLib.D3.Tools.RandomId(); + this.id = id|| GameLib.D3.Tools.RandomId(); + if (typeof name == 'undefined') { + name = this.constructor.name; + } + this.name = name; + this.parentEntity = null; // Todo: this should be executed somewhere in game-lib-z, so that we don't execute it on every construction of an object. diff --git a/src/game-lib-component-vehicle-ai-object-avoidance.js b/src/game-lib-component-vehicle-ai-object-avoidance.js index 64daedc..1d920b5 100644 --- a/src/game-lib-component-vehicle-ai-object-avoidance.js +++ b/src/game-lib-component-vehicle-ai-object-avoidance.js @@ -1,14 +1,21 @@ /** * - * @param componentId + * @param id + * @param name * @param physicsWorld * @constructor */ GameLib.D3.ComponentVehicleAIObjectAvoidance = function( - componentId, + id, + name, physicsWorld ) { - this.componentId = componentId || GameLib.D3.Tools.RandomId(); + this.id = id|| GameLib.D3.Tools.RandomId(); + if (typeof name == 'undefined') { + name = this.constructor.name; + } + this.name = name; + this.parentEntity = null; GameLib.D3.Utils.Extend(GameLib.D3.ComponentVehicleAIObjectAvoidance, GameLib.D3.ComponentInterface); diff --git a/src/game-lib-component-vehicle-ai-path-boid.js b/src/game-lib-component-vehicle-ai-path-boid.js index d432d36..0c213cb 100644 --- a/src/game-lib-component-vehicle-ai-path-boid.js +++ b/src/game-lib-component-vehicle-ai-path-boid.js @@ -1,16 +1,23 @@ /** * - * @param componentId + * @param id + * @param name * @param targetEntity GameLib.D3.Entity * @param nodePath * @constructor */ GameLib.D3.ComponentVehicleAIPathBoid = function( - componentId, + id, + name, targetEntity, nodePath ) { - this.componentId = componentId || GameLib.D3.Tools.RandomId(); + this.id = id|| GameLib.D3.Tools.RandomId(); + if (typeof name == 'undefined') { + name = this.constructor.name; + } + this.name = name; + this.parentEntity = null; GameLib.D3.Utils.Extend(GameLib.D3.ComponentVehicleAIPathBoid, GameLib.D3.ComponentInterface); diff --git a/src/game-lib-component-vehicle-ai-path-steering.js b/src/game-lib-component-vehicle-ai-path-steering.js index 1f95eb7..7e28974 100644 --- a/src/game-lib-component-vehicle-ai-path-steering.js +++ b/src/game-lib-component-vehicle-ai-path-steering.js @@ -1,18 +1,25 @@ /** * - * @param componentId + * @param id + * @param name * @param targetEntity GameLib.D3.Entity * @param steeringSpeed * @param maxSteerAngle * @constructor */ GameLib.D3.ComponentVehicleAIPathSteering = function( - componentId, + id, + name, targetEntity, steeringSpeed, maxSteerAngle ) { - this.componentId = componentId || GameLib.D3.Tools.RandomId(); + this.id = id|| GameLib.D3.Tools.RandomId(); + if (typeof name == 'undefined') { + name = this.constructor.name; + } + this.name = name; + this.parentEntity = null; // Todo: this should be executed somewhere in game-lib-z, so that we don't execute it on every construction of an object.