#include <rulesystem.h>
Public Methods | |
bool | checkDependencies () |
TFleet * | createFleet () const |
TItem * | createItem (int2 type) const |
TRace * | createRace () const |
TSystem * | createSystem () const |
TRuleAtom * | fetchRule (const string &ruleName) const |
const list< TRuleSystem::tError > * | getErrorList () const |
string | getModule (const string &module) const |
bool | getStatus () const |
bool | load (TDataPackageList *in) |
void | reset () |
bool | save (TDataPackageList *out) const |
bool | setModule (const string &module, const string &rule) |
bool | setRuleAtom (const string &rule, const string &ruleset) |
Static Public Methods | |
TRuleSystem & | instance () |
Protected Methods | |
TRuleSystem () | |
Private Attributes | |
list< tError > | fErrorList |
map< string, string > | fModules |
map< string, string > | fRules |
bool | fVerified |
FIXME
what are rules, modules?
Singelton, reset => set rules, modules => check dependencies => you can ask for rules etc.
|
Calls calls reset. Note: The constructor is protected to ensure that there is exactly one instance of this class available.
|
|
Call this method to find out if all rule atoms and modules play nicely together or not and to find out if all neccessary information was provided. (Some rule atoms might need special modules to work properly). This check was introduced to make mixing different rule systems possible without crashing the game. A successful check of the dependencies sets fVerified to
|
|
Creates an empty fleet depending on the game rules (e.g. TFleetBasic, TFleetSL, TFleetStars). Note: The fleet is not added to the galaxy (see TGalaxy::Add). Also note that the caller is in charge of deallocation!
|
|
Creates an item depending on the itemtype. Possible item types are described in TItem. Note that the caller is in charge of deallocation!
|
|
Creates an empty race depending on the game rules (e.g. TRaceBasic, TRaceSL, TRaceStars). Note that the caller is in charge of deallocation!
|
|
Creates an empty system depending on the game rules (e.g. TSystemBasic, TSystemSL, TSystemStars). Note: The system is not added to the galaxy (see TGalaxy::Add). Also note that the caller is in charge of deallocation!
|
|
Looks up a specific rule (please see TRuleAtom for more information and example code).
|
|
|
|
|
|
|
|
|
|
Loads a TRuleSystem object. Note that you have to call checkDependencies after loading on your own and also note that this method triggers a call to the reset method.
|
|
Sets the modules and the rule atoms to the default value: NONE. Especially this means that fVerified is set to |
|
Saves a TRuleSystem object by adding the data packages to the list.
|
|
Sets the used rule set for a module. Note that no dependency check is done (see checkDependencies) and also note that you have to check dependencies again after calling this method.
|
|
Sets the used rule set for a rule atom. Note that no dependency check is done (see checkDependencies) and also note that you have to check dependencies again after calling this method.
|
|
List of errors from the last check dependencies call |
|
Stores which version of a module (e.g. fleet, race, etc.) is used |
|
Stores which rule system for the rule atoms are used in this game |
|
Stores the information if all rule atoms / modules play nicely together or not.
|