The default implementation of the IPluginEngine interface. PluginEngine finds and keeps track of all plugin modules located in the /plugins subdirectory. The functions required by the IPluginEngine interface are implemented using the various methods of storing the plugin module information. See the function and variable documentation below.
PluginEngine.h
The default implementation of the IPluginEngine interface. | |
The PlugineEngine constructor. | |
Starts the PluginEngine. | |
Stops the PluginEngine. | |
Fills the given array with all loaded RuleSets. | |
Determines if a plugin module is loaded. | |
Determines if a RuleSet within a given module is loaded. | |
Loads a RuleSet into the GameEngine. | |
Loads an AI into the GameEngine. | |
Retreives PlayerData from all of the currently loaded RuleSets. | |
The default PluginEngine constructor. | |
Loads data from the given RuleSet into the GameEngine. | |
Still volatile. | |
Finds plugin modules in the /plugins directory. | |
The std::map of the names of RuleSet-providing modules to the paths to those modules. | |
The std::map of the names of AI-providing modules to the paths to those modules. | |
The std::map of RuleSet-providing module names to the wxDynamicLibrary containing the loaded module. | |
The std::map of AI-providing module names to the wxDynamicLibrary containing the loaded module. | |
The std::vector of loaded RuleSets, grouped by the module they were loaded from, and preserved in load order. | |
The std::vector of loaded AIs, grouped by the module they were loaded from, and preserved in load order. | |
The boost::weak_ptr to the RuleEngine that will receive IRule and ILogic data from any RuleSets being loaded. | |
The boost::weak_ptr to the GameObjectEngine that will receive IGameObject data from any RuleSets being loaded. | |
The boost::weak_ptr to the DrawObjectEngine that will receive IDrawObject data from any RuleSets being loaded. | |
The boost::weak_ptr to the ImageEngine that will receive ImageSet data from any RuleSets being loaded. |
The PlugineEngine constructor. | |
Starts the PluginEngine. | |
Stops the PluginEngine. | |
Fills the given array with all loaded RuleSets. | |
Determines if a plugin module is loaded. | |
Determines if a RuleSet within a given module is loaded. | |
Loads a RuleSet into the GameEngine. | |
Loads an AI into the GameEngine. | |
Retreives PlayerData from all of the currently loaded RuleSets. | |
| void Start() |
Starts the PluginEngine. Calls FindPlugins to locate available plugin modules. Then loads the Core RuleSet out of the CoreRules module.
|
Fills the given array with all loaded RuleSets. The RuleSets are stored in the array in a std::pair where the first element is the name of the module the RuleSet is in, and the second element is the name of the <Ruleset> itself.
| array | The array to fill with loaded RuleSet information. |
|
Determines if a plugin module is loaded. Checks in the RuleSet PluginMap for a module with the given name. If an entry is found, the RuleSet has been loaded.
| module | The name of the plugin module to check. |
A bool stating if the module is loaded. The value is true if it is, false if not.
|
Determines if a RuleSet within a given module is loaded. First calls the module-only version of IsLoaded to see if the module has been loaded. If so, checks in the std::list of loaded RuleSets for that module name to see if the given RuleSet has been loaded.
| module | The name of the module the RuleSet is in. |
| ruleset | The name of the RuleSet to check. |
A bool stating if the RuleSet is loaded. The value is true if both the module and RuleSet or loaded, and false if either the RuleSet, or the module is not loaded.
|
Loads a RuleSet into the GameEngine. Immediately checks to see if the module is even available to load. If yes, and the module has not been loaded into memory, it is loaded via wxWidget’s wxDynamicLibrary class. The loaded module is then queried for the ProvideRuleSets function. If the module fails to load, or fails to provide the proper access function, LoadRuleset fails and returns false.
Once the ProvideRuleSets function has been located, a const reference to a std::map of RuleSets is created from the return value of the ProvideRuleSets function. The std::map is searched for the name of the RuleSet to load. If the module does not provide the RuleSet (i.e., it is not in the std::map), the function fails and returns false. If the module provides the given RuleSet, it is then loaded into the GameEngine by calling LoadRulesetPrivate.
| module | The name of the module the RuleSet is in. |
| ruleset | The RuleSet to load. |
A bool indicating the success of the load. The value is true if the RuleSet was loaded, false if not.
|
Loads an AI into the GameEngine. Still volatile.
| module | The name of the module the AI is in. |
| ai | The AI to load. |
A bool indicating the success of the load. The value is true if the AI was loaded, false if not.
|
Retrieves BankData from all of the currently loaded RuleSets. Searches through all loaded RuleSets, checking to see if they provide any BankData. If BankData is provided by a RuleSet, it is appended to the outgoing std::vector.
| array | The outgoing array of BankData that will be filled by the function. |
|
Retreives PlayerData from all of the currently loaded RuleSets. Searches through all loaded RuleSets, checking to see if they provide any PlayerData. If PlayerData is provided by a RuleSet, it is appended to the outgoing std::vector.
| array | The outgoing array of PlayerData that will be filled by the function. |
|
Retreives BuildData from all of the currently loaded RuleSets. Searches through all loaded RuleSets, checking to see if they provide any BuildData. If BuildData is provided by a RuleSet, it is appended to the outgoing std::vector.
| array | The outgoing array of BuildData that will be filled by the function. |
The default PluginEngine constructor. | |
Loads data from the given RuleSet into the GameEngine. | |
Still volatile. | |
Finds plugin modules in the /plugins directory. | |
The std::map of the names of RuleSet-providing modules to the paths to those modules. | |
The std::map of the names of AI-providing modules to the paths to those modules. | |
The std::map of RuleSet-providing module names to the wxDynamicLibrary containing the loaded module. | |
The std::map of AI-providing module names to the wxDynamicLibrary containing the loaded module. | |
The std::vector of loaded RuleSets, grouped by the module they were loaded from, and preserved in load order. | |
The std::vector of loaded AIs, grouped by the module they were loaded from, and preserved in load order. | |
The boost::weak_ptr to the RuleEngine that will receive IRule and ILogic data from any RuleSets being loaded. | |
The boost::weak_ptr to the GameObjectEngine that will receive IGameObject data from any RuleSets being loaded. | |
The boost::weak_ptr to the DrawObjectEngine that will receive IDrawObject data from any RuleSets being loaded. | |
The boost::weak_ptr to the ImageEngine that will receive ImageSet data from any RuleSets being loaded. |
|
Loads data from the given RuleSet into the GameEngine. First appends the RuleSet name and module name to the std::vector of std::lists of open rulesets to record the loading of the RuleSet and the order in which it happened. Then locks the boost::weak_ptrs to the RuleEngine, DrawObjectEngine, and ImageEngine so that they can be used. Copies all of the IRules, ILogic, mixin strings, and branch priority ILogic from the RuleSet into the RuleEngine. Copies all of the IGameObjects from the RuleSet into the GameObjectEngine. Copies all of the IDrawObjects from the RuleSet into the DrawObjectEngine. Copies all of the ImageSets from the RuleSet into the ImageEngine.
| ruleset | The RuleSet being loaded. |
| module | The name of the module the RuleSet is in. |
| name | The name of the RuleSet. |
| void FindPlugins() |
Finds plugin modules in the /plugins directory. Examines each file that ends in .dll on Win32 or .so on Linux, within the plugins subdirectory. Examines each dynamic library to see if it provides a ProvideRuleSets or a ProvideAI function. If either is provided, the module name and path to the module are added as entries in the PluginMaps of RuleSets or AIs, respectively.
| StringMap mRulesetPaths |
The std::map of the names of RuleSet-providing modules to the paths to those modules.
| StringMap mAIPaths |
The std::map of the names of AI-providing modules to the paths to those modules.
| PluginMap mRulePlugins |
The std::map of RuleSet-providing module names to the wxDynamicLibrary containing the loaded module. A wxDynamicLibrary unloads its module from memory when it is destroyed, which means that the destruction of the std::map must happen after all previous memory shared across address spaces has been cleaned up.
The std::map of AI-providing module names to the wxDynamicLibrary containing the loaded module. A wxDynamicLibrary unloads its module from memory when it is destroyed, which means that the destruction of the std::map must happen after all previous memory shared across address spaces has been cleaned up.
| StringListPairArray mLoadedRulesets |
The std::vector of loaded RuleSets, grouped by the module they were loaded from, and preserved in load order.
| StringListPairArray mLoadedAIs |
The std::vector of loaded AIs, grouped by the module they were loaded from, and preserved in load order.
| boost::weak_ptr<RuleEngine> mpRuleEngine |
The boost::weak_ptr to the RuleEngine that will receive IRule and ILogic data from any RuleSets being loaded.
| boost::weak_ptr<GameObjectEngine> mpGameObjectEngine |
The boost::weak_ptr to the GameObjectEngine that will receive IGameObject data from any RuleSets being loaded.
| boost::weak_ptr<DrawObjectEngine> mpDrawObjectEngine |
The boost::weak_ptr to the DrawObjectEngine that will receive IDrawObject data from any RuleSets being loaded.
| boost::weak_ptr<ImageEngine> mpImageEngine |
The boost::weak_ptr to the ImageEngine that will receive ImageSet data from any RuleSets being loaded.
|
| void Start() |
| void Stop() |
|
|
|
|
|
|
|
|
|
| void FindPlugins() |
| StringMap mRulesetPaths |
| StringMap mAIPaths |
| PluginMap mRulePlugins |
| StringListPairArray mLoadedRulesets |
| StringListPairArray mLoadedAIs |
| boost::weak_ptr<RuleEngine> mpRuleEngine |
| boost::weak_ptr<GameObjectEngine> mpGameObjectEngine |
| boost::weak_ptr<DrawObjectEngine> mpDrawObjectEngine |
| boost::weak_ptr<ImageEngine> mpImageEngine |