Second UML design
To improve on that design I wanted to add the following functionnalities:
- Introduce the general concept of an attribute. An attribute is something that describes the entity. It can be the length, width, the name or any other kind of information. This has to be expandable since at this early stage of development, I don't know what is (and will) be needed.
- Add 'lazy evaluation' such that an entity derived from another only needs to store the difference between its attributes and its parent's attributes.
- Add 'states' information.
And here is what I came up with.
Instead of using a map with only strings, I think that using different maps for the different kinds of variables will optimize the queries. I still don't know if I'd rather use an id for the name or an actual string. My feeling is that an int would be faster for query searches and that a mapping between ints and strings would be easy to do in case someone needs the actual name. However I am not sure, so I'm leaving it blank for now.
EntityLocation is now renamed to AltimaEntity. The only difference between an Entity and an AltimaEntity is that the later exists somewhere in the world, it is an instantiation of an Entity. For example, an oak entity exist, but the oak tree that a player can interact with (cut, burn, etc.) is an AltimaEntity.
For viewing the world in 2D, a EntityGfx exists for every AltimaEntity. A graphic is not a simple sprite because graphics can be layered to represent an entity. The EntityGfx class doesn't have any pixmaps. It selects the appropriate pixmaps from the graphic database.
The use of arrows in the association between classes indicates that the association is one sided, i.e. EntityGfx knows about the altima entity but the altima entity doesn't know anything about the other.
Created: Sat Jan 16 18:05:12 EST 1999 - Last modified: Sat Jan 16 18:29:45 EST 1999