Table of Contents

Object-type refactoring

Reason

Currently in the crossfire code, how objects behave is intertwined all throughout the code, and this is in many ways a problem as it makes it difficult to find code related to a type of object. It's current state also makes it relatively difficult to add code for new object types. Though it will never be that easy to add object types, refactoring could improve this significantly. Also, refactoring this to separate code for different object types, will make it easier to find current overloading of object attributes, making it easier to eventually refactor the overloading out.

Proposal

General Idea

Implementation Details

Code organization

Function pointers

For per-object hooks if/when implemented, objects would have a struct member added as “ob_methods *methods;” (accessed as “ob→methods”). Per-arch hooks if/when implemented would be done as a similar struct member added to the archetype struct. In those cases, the “methods” pointer will be NULL unless there are methods in it.

Plan

To start

Policy

Later

Eventually...

More information