PongUIO/AndroidWars — Issue #3: Support for listeners for data loading
Author: Thekian
Created: 2012-02-19 15:26:39+00:00
State: open
Labels: extsim

Currently ExtS::BaseData and derivatives only load a Script::Block for themselves (BaseData::loadBlock() ), but this is limiting for outside systems who wish to read extended data. For example, the GUI could use listeners to read which graphics files are used by a bot type.

Two types of listeners should be present, one for reading extended type data and one that allows for reading new root blocks.

For reading extended type data, there should be a list of listeners in a database, each listener should implement a function that takes parameters on the form readBlock(Script::Block &block, Type *srcData) , where Type is the main data type for that database.

For reading new root blocks, it should suffice to extend the current ExtS::ExtData system by allowing multiple listeners per root block tag, making listener registration public, and also allow more flexible listener contexts.

This issue depends partially on an improved system for DefaultData where DefaultData should further abstract some common behaviours like Type allocation and TypeRule generation.

See: extsim/BaseData.h, extsim/ExtData.h, and dependency "ExtS::DefaultData improvements".