Another thing, I managed to create an empty (presumably set to default arguments, that much I could dig out of the code) TemplateParams. Here's the code:
print("PLayer : ", type(layer)) print("template: ", type(template)) print("name : ", type(name)) print("params : ", type(params)) print("------------------") # CreateEntity(iCelPlLayer *,iCelEntityTemplate *,char const *,celEntityTemplateParams const &) e = CreateEntity(PhysicalLayer, template, name, params) And here the result: ('PLayer : ', <class 'blcelc.iCelPlLayer'>) ('template: ', <class 'blcelc.iCelEntityTemplate'>) ('name : ', <type 'str'>) ('params : ', <class 'blcelc.celEntityTemplateParams'>) ------------------ Traceback (most recent call last): File "chessboard.py", line 17, in __init__ self.createTile(x,y) File "chessboard.py", line 73, in createTile e = CreateEntity(PhysicalLayer, template, name, params) File "/home/baribal/src/CEL_latest/scripts/blcelc.py", line 465, in CreateEntity def CreateEntity(*args): return _blcelc.iCelPlLayer_CreateEntity(*args) NotImplementedError: Wrong number of arguments for overloaded function 'iCelPlLayer_CreateEntity'. Possible C/C++ prototypes are: CreateEntity(iCelPlLayer *) CreateEntity(iCelPlLayer *,uint) CreateEntity(iCelPlLayer *,char const *,iCelBlLayer *,char const *,...) CreateEntity(iCelPlLayer *,iCelEntityTemplate *,char const *,celEntityTemplateParams const &) The call should fit the last prototype. Except if the string isn't converted properly. Or something else went wrong. On Sat, Sep 25, 2010 at 8:57 AM, Sebastian Hoffmann <null.s.hoffm...@googlemail.com> wrote: > I figured out the problem. I'm using the wrong type for the > parameters. Wasn't as thorough as I should have been. Never mind that, > it got interesting. Using the right type leads to this here: > > File "chessboard.py", line 17, in __init__ > self.createTile(x,y) > File "chessboard.py", line 64, in createTile > params = celEntityTemplateParams({}) > File "/home/baribal/src/CEL_latest/scripts/blcelc.py", line 360, in __init__ > this = _blcelc.new_celEntityTemplateParams(*args) > NotImplementedError: Wrong number of arguments for overloaded function > 'new_celEntityTemplateParams'. > Possible C/C++ prototypes are: > csHash< csStringFast< 12 >,csStringFast< 12 >>,CS::Memory::AllocatorMalloc,csArrayElementHandler< > CS::Container::HashElement< csStringFast< 12 >,csStringFast< 12 > > > >>(size_t,size_t,size_t) > csHash< csStringFast< 12 >,csStringFast< 12 >>,CS::Memory::AllocatorMalloc,csArrayElementHandler< > CS::Container::HashElement< csStringFast< 12 >,csStringFast< 12 > > > >>(size_t,size_t) > csHash< csStringFast< 12 >,csStringFast< 12 >>,CS::Memory::AllocatorMalloc,csArrayElementHandler< > CS::Container::HashElement< csStringFast< 12 >,csStringFast< 12 > > > >>(size_t) > csHash< csStringFast< 12 >,csStringFast< 12 >>,CS::Memory::AllocatorMalloc,csArrayElementHandler< > CS::Container::HashElement< csStringFast< 12 >,csStringFast< 12 > > > >>() > csHash< csStringFast< 12 >,csStringFast< 12 >>,CS::Memory::AllocatorMalloc,csArrayElementHandler< > CS::Container::HashElement< csStringFast< 12 >,csStringFast< 12 > > > >>(csHash< csStringFast< 12 >,csStringFast< 12 >>,CS::Memory::AllocatorMalloc,csArrayElementHandler< > CS::Container::HashElement< csStringFast< 12 >,csStringFast< 12 > > > >> const &) > > I couldn't make heads or tails of it, or rather, what kind of data > structure was expected, so I took a walk through the code, but > couldn't find an answer there, either. The Python is pure passing > through arguments, and the C++-code is perfectly cryptic to me. Also, > there's pretty much zero documentation to go on. I'll keep on > experimenting blindly, but I could really use a helping hand. > > On Thu, Sep 23, 2010 at 12:37 PM, Sebastian Hoffmann > <null.s.hoffm...@googlemail.com> wrote: >> Thank you for all your help in my hurdles towards a first full game. >> >> The next hurdle is creation of entities from Python code. Here what I >> intend to do: >> >> def createTile(self, x, y): >> template = EntityTemplates["chessboardTile"] >> name = str(x)+"x"+str(y) >> params = parblock({"x": x, "y": y}) >> e = CreateEntity(template, name, params) >> >> What actually happens when the code hits parblock(): >> >> Traceback (most recent call last): >> File "chessboard.py", line 17, in __init__ >> self.createTile(x,y) >> File "chessboard.py", line 109, in createTile >> params = parblock(["x","y"]) >> File "/home/baribal/src/CEL_latest/scripts/blcelc.py", line 541, in >> CreateParameterBlock >> parblock.SetParameterDef (idx,keyid,valkey) >> File "/home/baribal/src/CEL_latest/scripts/blcelc.py", line 990, in >> SetParameterDef >> def SetParameterDef(*args): return >> _blcelc.celGenericParameterBlock_SetParameterDef(*args) >> TypeError: celGenericParameterBlock_SetParameterDef expected 3 arguments, >> got 4 >> >> According to the manual, parblock() *should* succeed as it is there. >> What's happening here? >> >> Liebe Grüße, >> Sebastian Hoffmann >> > ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Cel-main mailing list Cel-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cel-main