It work fine but I enconter a problem with AIFloat3 class and float3.h
Here my file .i for SWIG:
Code: Select all
#ifdef SWIG
%include <typemaps.i>
%include <carrays.i>
%include <std_string.i>
%include <std_vector.i>
%module AI
%{
#include "CppTestAI.h"
// Need:
#include "OOAICallback.h"
#include "Map.h"
#include "Unit.h"
#include "UnitDef.h"
#include "AIFloat3.h"
# etc ...
%}
%include "CppTestAI.h"
%include "OOAICallback.h"
%include "Map.h"
%include "Unit.h"
%include "UnitDef.h"
%include "AIFloat3.h"
% etc ...
%template(ListofUnits) std::vector<springai::Unit*>;
%template(ListofUnitDefs) std::vector<springai::UnitDef*>;
%template(ListofWeaponDefs) std::vector<springai::WeaponDef*>;
%template(ListofWeaponMounts) std::vector<springai::WeaponMount*>;
%template(ListofCommandDescriptions) std::vector<springai::CommandDescription*>;
%template(ListofCommands) std::vector<springai::Command*>;
%template(ListofFloat) std::vector<float>;
%template(ListofInt) std::vector<int>;
#endif
Warning 401: Nothing known about base class 'float3'. Ignored.
and AIFloat3 definition is not completed. I need to acces X,Y,Z fields for example.
Ok. AIFloat3 use base float3.
But If i add:
#include "float3.h"
and
%include "float3.h"
I get error:
Error: Syntax error in input(3).
(I download and compile spring from github twice t be sure that source are not corrupted).
Someone have a solution? (I'm not expert in C++.)