diff --git a/src/core/space.js b/src/core/space.js index 07f6fb3..0ef9727 100644 --- a/src/core/space.js +++ b/src/core/space.js @@ -4,6 +4,19 @@ if ( typeof define !== "function" ) { define( function( require ) { + function Space( clock ) { + // This will normally be the system simulation clock, but for a UI space + // it might be the realtime clock instead. + this.clock = new Clock( clock.signal ); // This clock controls updates for + // all entities in this space + this.id = guid(); + this.size = 0; // The number of entities in this space + + this._entities = {}; // Maps entity ID to object + this._nameIndex = {}; // Maps name to entity ID + this._tagIndex = {}; // Maps tag to entity ID + } + var guid = require( "common/guid" ); var Entity = require( "core/entity" ); var Clock = require( "core/clock" ); @@ -147,19 +160,6 @@ define( function( require ) { return result; } - function Space( clock ) { - // This will normally be the system simulation clock, but for a UI space - // it might be the realtime clock instead. - this.clock = new Clock( clock.signal ); // This clock controls updates for - // all entities in this space - this.id = guid(); - this.size = 0; // The number of entities in this space - - this._entities = {}; // Maps entity ID to object - this._nameIndex = {}; // Maps name to entity ID - this._tagIndex = {}; // Maps tag to entity ID - } - Space.prototype = { add: add, remove: remove,