Stendhal code design

From Arianne
Revision as of 01:21, 26 April 2007 by imported>Chad3f (Entities)
Jump to navigation Jump to search


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