setPrefs() getting skipped?

AI discussion, ideas, and SDK help.
Post Reply
fellowfreak
Lux Newbie
Posts: 4
Joined: Tue Oct 13, 2009 6:09 pm
Location: Austin

setPrefs() getting skipped?

Post by fellowfreak » Wed Nov 11, 2009 3:18 pm

I'm working on an agent that extends the SmartAgentBase. Until now I haven't bothered with the setPrefs() method because SmartAgentBase has its own...but when I just added in my own version of setPrefs(), it seems that it's not ever getting called!

I'm not sure how to ensure that my version of setPrefs() gets called.
Thanks in advance for your help.

fellowfreak
Lux Newbie
Posts: 4
Joined: Tue Oct 13, 2009 6:09 pm
Location: Austin

Post by fellowfreak » Wed Nov 11, 2009 3:43 pm

According to the documentation, I would expect that the game would be calling something like

myAgent.setPrefs();

after my agent gets constructed. This would allow it to default to SmartAgentBase.setPrefs() before I wrote my own. Once I write my own, it should be using myAgent's version, and printing out a simple message to the log (because of my code).

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10998
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Wed Nov 11, 2009 3:54 pm

hmm... make sure that you're matching the method signature, including the 2 parameters.

If you have this exact method in your agent, it should get called:

Code: Select all

public void setPrefs( int newID, Board theboard )

Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests