Stendhal code design: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Chad3f
No edit summary
imported>Chad3f
Line 5: Line 5:
=== Entities ===
=== Entities ===


Entity's are created using '''EntityFactory.createEntity()''':
Entity's are created using '''EntityFactory.createEntity()'''. In this method, the appropriete implementation class is created, and the '''initialize()''' method is called. When the entity is to be removed, the '''release()''' method should be called on it.

The design is being transitioned to a Model-View-Controller (MVC) like framework. This will allow different visual implementations (like 2D, 3D) to be plugged in with minimal (or no) changes of the model class.

'''Example:'''


RPObject object = ...
RPObject object = ...
Entity entity = EntityFactory.createEntity(object);
Entity entity = EntityFactory.createEntity(object);
// Force the view to be created
entity.getView();
...
...
Line 15: Line 22:
// Done with entity - free up resources
// Done with entity - free up resources
entity.release();
entity.release();



=== Sound System ===
=== Sound System ===

Revision as of 01:21, 26 April 2007


Client

Entities

Entity's are created using EntityFactory.createEntity(). In this method, the appropriete implementation class is created, and the initialize() method is called. When the entity is to be removed, the release() method should be called on it.

The design is being transitioned to a Model-View-Controller (MVC) like framework. This will allow different visual implementations (like 2D, 3D) to be plugged in with minimal (or no) changes of the model class.

Example:

RPObject object = ...

Entity entity = EntityFactory.createEntity(object);

// Force the view to be created
entity.getView();

  ...

// Done with entity - free up resources
entity.release();

Sound System

Server