Follow-up Comment #8, patch #1432 (project wesnoth):

> Do you think that 'method=' shortcut is really necessary ?

I can think of three reasons. 1. "(...):play_turn()" is damn ugly. 2. It
removes about 20 lines of C++ code. 3. It avoids an indirection.

> Is it a good way to make 'side' available to the external file? or it's
better to introduce a version of 'dofile' which accepts a second parameter?
or it's already possible to do?

No, no, and no. (Note that I'm not saying an improved dofile would be a bad
idea. Just that I don't think it would be much better in this situation.)

First, wesnoth.require should be used instead of dofile, so that all the AI
instances of the same engine share the same code. Second, the file should
only define a function, rather than directly return an AI, and this function
should then be called, possibly by passing side as an argument.

By the way, I still don't understand why you require the user to pass the
side parameter back to the Lua AI interface functions. There is only one sane
value, which is the current playing side.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1432>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to