]> git.r.bdr.sh - rbdr/serpentity/blobdiff - dist/serpentity.js
Removes bower.json
[rbdr/serpentity] / dist / serpentity.js
index 2f91c253fa0f0bf69901b35c84762a8c7f99f40d..1f9b250eadca63d61b7009d9c821d982a7f10fba 100644 (file)
@@ -50,7 +50,7 @@ eventually be consumed by "Systems"
 
 You can add components to entities by using the add method:
 
-    entity.add(new PositionComponent());
+    entity.addComponent(new PositionComponent());
 
 
 Systems can refer to entities by requesting nodes.
@@ -287,7 +287,7 @@ Class(Serpentity, "Entity")({
          *
          * returns true if added, false if already present
          */
-        add : function add(component) {
+        addComponent : function addComponent(component) {
             if (this._componentKeys.indexOf(component.constructor) >= 0) {
                 return false;
             }
@@ -472,7 +472,19 @@ Class(Serpentity, "NodeCollection")({
  * components can be any class whatsoever.
  */
 Class(Serpentity, "Component")({
+    prototype : {
+        init : function init(config) {
+            var property;
 
+            config = config || {};
+
+            for (property in config) {
+                if (config.hasOwnProperty(property)) {
+                    this[property] = config[property];
+                }
+            }
+        }
+    }
 });
 
 /*