PongUIO/AndroidWars — Issue #8: TypeRule support for building and passing input using ParamList
Author: Thekian
Created: 2012-02-23 16:01:27+00:00
State: open
Labels: extsim

A basic system is in place to read parameters and constraints using TypeRule and related classes. However, there is still no system to serialize the data from ParamList.

The system should be interacted with in the following manner (The ParamList may be stored indefinitely if so desired):
1. The user requests a ParamList copy using TypeRule::makeParam()
2. The user analyzes this list and alters it through the use of RuleParameter listener callbacks.
3. The updated ParamList is fed back to the originating TypeRule to a function that requests a serialized version of it.
4. The serialized data is passed to ExtInput.
5. When the ParamList is not needed anymore, it may be deleted. Note that the ParamList may be reused.

Part 3 is the most relevant for this issue, and the implementation of this should be fairly straightforward. One virtual function in TypeRule is needed that takes a ParamList object and a Save::BasePtr object. The serialized data must be compatible with ExtInput. Rudimentary error checking should be a part of the implementation. The TypeRule has no responsibility of doing detailed error checking on the input ParamList (such as checking that the parameters are of the right type) as it is expected that the caller takes care of this. Note that a basic error checking system is to store and compare a pointer in a ParamList to mark its parent TypeRule.

See: extsim/TypeRule.h/.cpp, extsim/typerule/*, and extsim/param/*