Changes for version 0.10

  • WARNING: This version is a redesign of several key components of the system. This version is most likely incompatible with all older versions.
  • Instead of using Games::Object as the object manager as well as the object structure, a new Games::Object::Manager module has been added. A manager acts as a container for objects, thus stuff that used to be functions (like Find(), Process(), etc) are now methods on the manager. Thus you can manage several lists of self-contained objects. This is much more in keeping with an overall OO approach.
  • The event system was ripped out and rewritten from scratch. The new version is much more integrated into the objects, so it appears more seamless. This has the nice side-effect of getting rid of the GlobalObject kludginess. The new code is actually smaller than the original.
  • With the introduction of object managers, I have been able to provide a framework for defining and tracking object relationships. Object inheritance is now simply a predefined object relationship referenced by the Games::Object module.
  • Ripped out the class registration code for non-Games::Object derived object references. Instead, I simply require that you have a load() and save() method to handle file IO (id and find methods no longer needed). This is more in keeping with OO programming methodology.
  • A new flag provided to have simplified accessor methods autocreated for you when adding attributes (and yes, I considered using AUTOLOAD, but I don't much care for it because of the inheritance nightmare, and to quote the Perl Cookbook: "AUTOLOAD eventually begins to feel like a kludge piled on a hack piled on a workaround")
  • User-defined object flags are created on objects on the fly as needed, much like attributes, rather than requiring the user to predefine them globally.
  • You can now choose the starting ID for auto-generated object IDs (object IDs now maintained by the object manager module).
  • Fixed bug where -w on Perl 5.8.0 gave "v-string ... non-portable" warning.
  • Added overloaded operators so objects can be compared more easily.
  • You can now specify an arbitrary filter function when processing all objects in a manager (i.e. the functionality handled by Process() in previous versions).
  • Adjusted some tests to deal with Perl 5.8.0 weirdness causing false test failures on some platforms (this one a suspected mathematical precision problem).

Modules

Provide a base class for game objects

Provides

in Object/Common.pm
in Object/Manager.pm