[SCM] Development fot GoFind! branch, master, updated. 41c32de2bf6bf8b3baa00bbd552c00eb2f9a8f08
Miriam Ruiz
miriam at debian.org
Sat Nov 22 11:54:00 UTC 2008
The following commit has been merged in the master branch:
commit 8f7599408054c7cb847d42df4f1bd76b76946071
Author: Miriam Ruiz <miriam at debian.org>
Date: Sat Nov 22 12:36:25 2008 +0100
Send data to plugin in its own class, instead of sending the Engine object directly
diff --git a/gofind.cpp b/gofind.cpp
index 4899b7d..73c7ec7 100644
--- a/gofind.cpp
+++ b/gofind.cpp
@@ -443,7 +443,8 @@ int main(int argc, const char* argv[])
printResults(engine);
*/
- gui->Go(engine);
+ GUIPlugInData data(engine);
+ gui->Go(data);
delete gui;
return 0;
diff --git a/gui_cli.cpp b/gui_cli.cpp
index 4e121d5..3c8a5fb 100644
--- a/gui_cli.cpp
+++ b/gui_cli.cpp
@@ -68,7 +68,7 @@ class GUIPlugInCLI : public GUIPlugIn
}
virtual void Comment(const char *szFormat, ...);
- virtual bool Go(Engine &engine);
+ virtual bool Go(GUIPlugInData &data);
};
void GUIPlugInCLI::Comment(const char *szFormat, ...)
@@ -85,9 +85,10 @@ void GUIPlugInCLI::Comment(const char *szFormat, ...)
std::cout << "# " << str << std::endl;
}
-bool GUIPlugInCLI::Go(Engine &engine)
+bool GUIPlugInCLI::Go(GUIPlugInData &data)
{
std::ostream &out = std::cout;
+ Engine &engine = data.GetEngine();
bool run = true;
diff --git a/guiplugin.h b/guiplugin.h
index 6d0f4b9..60e13f3 100644
--- a/guiplugin.h
+++ b/guiplugin.h
@@ -33,6 +33,22 @@ using namespace ept;
class GUIPlugInFactory;
+class GUIPlugInData
+{
+ public:
+ GUIPlugInData(Engine &e) : engine(e)
+ {
+ }
+
+ Engine &GetEngine()
+ {
+ return engine;
+ }
+
+ protected:
+ Engine &engine;
+};
+
class GUIPlugIn
{
public:
@@ -41,10 +57,10 @@ class GUIPlugIn
virtual ~GUIPlugIn();
virtual void Comment(const char *szFormat, ...) = 0;
- virtual bool Go(Engine &engine) = 0;
+ virtual bool Go(GUIPlugInData &data) = 0;
protected:
- GUIPlugInFactory *factory;
+ GUIPlugInFactory *factory;
};
class GUIPlugInFactory
--
Development fot GoFind!
More information about the Pkg-games-commits
mailing list