summaryrefslogtreecommitdiff
path: root/bindings/quackle.i
diff options
context:
space:
mode:
authorGökçen Eraslan <gokcen.eraslan@gmail.com>2016-01-06 19:50:21 +0100
committerGökçen Eraslan <gokcen.eraslan@gmail.com>2016-01-06 19:50:21 +0100
commitdcb66bd8ebe8a4f8ee6605b00af09e8a48ace0ff (patch)
tree5e5a7aafb12bf65246265b9f6e82f817842898ca /bindings/quackle.i
parentdf31cc20c63c9447ba057d599d48cc67c4555ca7 (diff)
Add a SWIG interface file, a Bash script to generate Go, Python and Lua bindings and add Python test file.
Diffstat (limited to 'bindings/quackle.i')
-rw-r--r--bindings/quackle.i101
1 files changed, 101 insertions, 0 deletions
diff --git a/bindings/quackle.i b/bindings/quackle.i
new file mode 100644
index 0000000..8ded915
--- /dev/null
+++ b/bindings/quackle.i
@@ -0,0 +1,101 @@
+%module quackle
+%{
+#include "fixedstring.h"
+#include "uv.h"
+#include "alphabetparameters.h"
+#include "move.h"
+#include "rack.h"
+#include "bag.h"
+#include "board.h"
+#include "boardparameters.h"
+#include "evaluator.h"
+#include "catchall.h"
+#include "player.h"
+#include "game.h"
+#include "gameparameters.h"
+#include "sim.h"
+#include "computerplayer.h"
+#include "computerplayercollection.h"
+#include "datamanager.h"
+#include "endgame.h"
+#include "endgameplayer.h"
+#include "enumerator.h"
+#include "bogowinplayer.h"
+#include "clock.h"
+#include "generator.h"
+#include "gaddag.h"
+#include "lexiconparameters.h"
+#include "preendgame.h"
+#include "reporter.h"
+#include "resolvent.h"
+#include "strategyparameters.h"
+
+#include <QString>
+#include "quackleio/flexiblealphabet.h"
+#include "quackleio/util.h"
+#include "quackleio/logania.h"
+#include "quackleio/gcgio.h"
+%}
+
+%include "std_string.i"
+%include "std_vector.i"
+
+/*Needed to generate proper iterable types */
+%template(MoveVector) std::vector<Quackle::Move>;
+%template(PlayerVector) std::vector<Quackle::Player>;
+%template(ProbableRackList) std::vector<Quackle::ProbableRack>;
+%template(PositionList) std::vector<Quackle::GamePosition>;
+
+%include "fixedstring.h"
+%include "uv.h"
+%include "alphabetparameters.h"
+%include "move.h"
+%include "rack.h"
+%include "bag.h"
+%include "board.h"
+%include "boardparameters.h"
+%include "evaluator.h"
+%include "catchall.h"
+%include "player.h"
+
+/* handle output arguments of PlayerList methods using cool SWIG typemaps */
+/* what we do here is just to tell SWIG that last bool& argument is an output argument */
+%include "typemaps.i"
+
+using namespace std;
+namespace Quackle
+{
+ class PlayerList : public vector<Player>
+ {
+ public:
+ PlayerList();
+
+ const Player &playerForId(int id, bool &OUTPUT) const;
+ const Player &playerForName(const UVString &name, bool &OUTPUT) const;
+ };
+}
+
+%include "game.h"
+%include "gameparameters.h"
+%include "sim.h"
+%include "computerplayer.h"
+%include "computerplayercollection.h"
+%include "datamanager.h"
+%include "endgame.h"
+%include "endgameplayer.h"
+%include "enumerator.h"
+%include "bogowinplayer.h"
+%include "clock.h"
+%include "generator.h"
+%include "gaddag.h"
+%include "lexiconparameters.h"
+%include "preendgame.h"
+%include "reporter.h"
+%include "resolvent.h"
+%include "strategyparameters.h"
+
+%include <QString>
+%include "quackleio/flexiblealphabet.h"
+%include "quackleio/util.h"
+%include "quackleio/logania.h"
+%include "quackleio/gcgio.h"