From dcb66bd8ebe8a4f8ee6605b00af09e8a48ace0ff Mon Sep 17 00:00:00 2001 From: Gökçen Eraslan Date: Wed, 6 Jan 2016 19:50:21 +0100 Subject: Add a SWIG interface file, a Bash script to generate Go, Python and Lua bindings and add Python test file. --- bindings/quackle.i | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 bindings/quackle.i (limited to 'bindings/quackle.i') 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 +#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; +%template(PlayerVector) std::vector; +%template(ProbableRackList) std::vector; +%template(PositionList) std::vector; + +%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 + { + 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 +%include "quackleio/flexiblealphabet.h" +%include "quackleio/util.h" +%include "quackleio/logania.h" +%include "quackleio/gcgio.h" -- cgit v1.2.3