Skip to content

Commit

Permalink
Refined docs
Browse files Browse the repository at this point in the history
  • Loading branch information
qiao committed Feb 3, 2013
1 parent 6de338a commit 97e5d1f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 12 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var Health = CES.Component.extend({
});
```

An entity is simply a container of the components.
An entity is essentially a container of one or more components.

```js
var hero = new CES.Entity();
Expand All @@ -51,8 +51,9 @@ hero.addComponent(new Velocity(0, 0));
hero.addComponent(new Health(100));
```

A system will get from the world the entities having one or more components,
and update the components accordingly.
The system is responsible for updating the entities.
In a real game there may be a lot of systems, like `CollisionSystem`,
`RenderSystem`, `ControlSystem` etc.

```js
var PhysicSystem = CES.System.extend({
Expand All @@ -72,7 +73,8 @@ var PhysicSystem = CES.System.extend({
```

The world is the container of all the entities and systems.
Calling the `update` method will sequentially update all systems.
Calling the `update` method will *sequentially* update all the systems,
in the order they were added.

```js
var world = new CES.World();
Expand Down
3 changes: 2 additions & 1 deletion src/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var Class = require('./class');

/**
* A component is the container of some properties that
* The components is the container of some properties that
* the entity possesses. It may also contain some methods.
* @class
*/
Expand All @@ -11,6 +11,7 @@ var Component = module.exports = Class.extend({
* should be unique.
* @public
* @readonly
* @property {String} name
*/
name: ''
});
2 changes: 1 addition & 1 deletion src/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var Class = require('./class'),
Signal = require('./signal');

/**
* An entity is a container of components.
* The entity is the container of components.
* @class
*/
var Entity = module.exports = Class.extend({
Expand Down
4 changes: 2 additions & 2 deletions src/entitylist.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var Class = require('./class');

/**
* An entity node is a wrapper around an entity, to be added into
* The entity node is a wrapper around an entity, to be added into
* the entity list.
* @class
*/
Expand All @@ -14,7 +14,7 @@ var EntityNode = Class.extend({
});

/**
* An entity list is a doubly-linked-list which allows the
* The entity list is a doubly-linked-list which allows the
* entities to be added and removed efficiently.
* @class
*/
Expand Down
2 changes: 1 addition & 1 deletion src/family.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var Class = require('./class'),
EntityList = require('./entitylist');

/**
* A family is a collection of entities having all the specified components.
* The family is a collection of entities having all the specified components.
* @class
*/
var Family = module.exports = Class.extend({
Expand Down
2 changes: 1 addition & 1 deletion src/signal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var Class = require('./class');

/**
* A signal can register listeners add invoke the listeners with messages.
* The signal can register listeners and invoke the listeners with messages.
* @class
*/
var Signal = module.exports = Class.extend({
Expand Down
2 changes: 1 addition & 1 deletion src/system.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var Class = require('./class');

/**
* A system is responsible for updating the entities.
* The system is responsible for updating the entities.
* @class
*/
var System = module.exports = Class.extend({
Expand Down
2 changes: 1 addition & 1 deletion src/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Class = require('./class'),
EntityList = require('./entitylist');

/**
* A world is the container of all the entities and systems.
* The world is the container of all the entities and systems.
* @class
*/
var World = module.exports = Class.extend({
Expand Down

0 comments on commit 97e5d1f

Please sign in to comment.