
This throws out the custom smart_list class in favor of a plain std::list. It also greatly simplifies a few things. First, event handlers no longer remove themselves from the main list in event_handlers. Now they just flag themselves as disabled (which means they will never execute once marked) and cleaned up later in a newly added cleanup stage. This means a handler no longer needs to keep its index in the active handler vector. This removal of reliance on indices also means I could add the aforementioned cleanup stage. With the smart_list code, event handlers were never actually removed from the active vector, nor any weak_ptrs pointing to them removed either. This wasn't exactly a problem, since the handlers were stored via shared_ptrs which would then simply be null after one deleted itself. Still, it's cleaner to drop any invalid ones (and unlockable weak_ptrs) from any relevant containers. I've opted to do this in manager::execute_on_events. Seems a good enough place as any. The net result of this is the code is much cleaner. We're able to get rid of a bunch of unnecessary feelers into various classes. This also makes the manager::iteration dereference code a lot easier to understand. There certainly could be further refactoring, but I think this is a good start.
About
The Battle for Wesnoth is a Free, turn-based tactical strategy game with a high fantasy theme, featuring both singleplayer and online/hotseat multiplayer combat. Fight a desperate battle to reclaim the throne of Wesnoth, or take hand in any number of other adventures.
License
The game's source code and artwork, sound, and music assets are provided under the terms of the GNU General Public License version 2, or (at your option) any later version. Note that for artwork, sound, and music, we interpret "preferred form of the work for making modifications" as the modifiable form that the author chooses to ship us for the source tree. For convenience, a reference copy of the GNU GPL version 2 is provided in the COPYING file in this distribution.
Some portions of the source code can be used under different license terms, whenever stated as such in the source.
Installing
See INSTALL for instructions on how to build the game from source code.
More Information
For extensive documentation about all aspects of the game, see the official Battle for Wesnoth web site.
A (translated) description of how to play the game can be found in doc/manual/manual.*.html, or online at:
The official Battle for Wesnoth Forums (with over 400,000 posts from more than 20,000 registered members) can be found at: