LGP Objects

From NexusCrossing

Jump to: navigation, search

[edit] LGP Project Components (TOC)

[edit] Introduction

All game worlds have things in them. These things include people, creatures, objects, etc. I intend for libGamePieces to be able to support objects in a flexible and logical way. One important thing from a programmer's and later a world developer's standpoint is the ability to create and track objects. This will be achieved through the use of an Object list. class lgp::Worldlist includes an element named ObjectListM. Coupled with the method getObjectById(), the programmer will be able to access objects, and manipulate them in various ways. It's main purpose is to be able to let the programmer locate the object they are using and retrieve the basic information needed to access that object.

In practice, when an object is created it is added to the object list. When an object is destroyed, it is removed from the object list. Each instance of lgp::World will maintain a count of existing objects, as well as the highest Object ID that has been assigned to an object that it contains.

[edit] Object Class Structure Diagram This section will be modified soon

Developers note: As is to be expected at early stages of development, the diagram here may quite possibly be scrapped in the near future. I am making some changes to the way that I envision the classes working together. The picture can stay for now, but when all is said and done it may need to be edited or changed all together. Emry 09:07, 4 December 2008 (UTC)

Image:Objects.png


The image above represents a very abstract image of the world at large.

  • The ObjectList is a container that holds all of the objects in an organized manner.
  • lgpObject represents a class that is the parent class of all other object related classes. It holds the code that adds objects to the ObjectList and removes them. It holds a default version of every public member function for classes derived from it. These default member functions basically return a response indicating that the object does not have that functionality.
  • lgpItem and lgpCreature are the Generic Core objects that will hold information specific too all Creatures and all Items. These will serve as generic implementation classes that define the default behavior for objects of their type.

A lot is still up in the air at this point. Everything is still in the planning stages. the code in the darcs repository will be updated soon, and a link will be posted to the repo.

Personal tools