Code: Select all
public void setPrefs( int newID, Board theboard )
{
ID = newID;
board = theboard;
countries = board.getCountries();
numCountries = countries.length;
numContinents = board.getNumberOfContinents();
agents = new LuxAgent[5];
agents[0] = new Killbot();
agents[1] = new Boscoe();
agents[2] = new Quo();
agents[3] = new Reaper();
agents[4] = new EvilPixie();
for( int i=0; i<agents.length; i++)
agents[i].setPrefs(newID, theboard);
}
Unfortunately, my problem right now is that I keep getting java.lang.NullPointerException errors. My problem seems to be similar actually to that reported here: http://sillysoft.net/forums/viewtopic.php?p=55385. I also get this sort of exception sometimes:
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1176)
at com.sillysoft.lux.B.A(Unknown Source)
at com.sillysoft.lux.B.A(Unknown Source)
at com.sillysoft.lux.Board.attack(Unknown Source)
at com.sillysoft.lux.Board.attack(Unknown Source)
at com.sillysoft.lux.agent.SmartAgentBase.attackForCard(Unknown Source)
at com.sillysoft.lux.agent.SmartAgentBase.attackForCard(Unknown Source)
at com.sillysoft.lux.agent.BetterPixie.attackPhase(Unknown Source)
at com.sillysoft.lux.agent.Vulture.attackPhase(Unknown Source)
at com.sillysoft.lux.B._(Unknown Source)
at com.sillysoft.lux.B.P(Unknown Source)
at com.sillysoft.lux.B.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)
Has anyone ever stumbled on this issue and found a way to resolve it? That would be great, as my idea for a new AI bot is centered around the use of other sub-bots...
Thanks!