Skip to content

Commit

Permalink
Revert moving of constructor next to prototype in favor of doing this…
Browse files Browse the repository at this point in the history
… as part of issue gladiusjs#202
  • Loading branch information
Dan Mosedale committed May 25, 2012
1 parent 2c90499 commit 80ae346
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/space.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 80ae346

Please sign in to comment.