list of countries

Lux maps won't make themselves.
Post Reply
qFox
Luxer
Posts: 199
Joined: Sat Dec 18, 2004 5:38 pm
Location: NL
Contact:

list of countries

Post by qFox » Sun Jan 02, 2005 10:14 am

I hate to go for the obvious, but are the supplied sources like Country.java and Board.java placeholders or something?

I was trying to figure out how a Country was constructed, because I want to create some methods for creating a new set of countries (player specific), but I noticed that all the sources returned static crap, -1 or false or something. So ... they must be like placeholders :)

Anyways, how do I add a card to a list of Country[] ? Or remove one...

User avatar
guest
Luxer
Posts: 189
Joined: Fri Dec 17, 2004 9:17 pm
Location: Southern NH
Contact:

Post by guest » Sun Jan 02, 2005 12:53 pm

You can't resize an java array dynamicaly. You'll have to A. make a new array of the rigth size and copy over what you want. B. make an oversized array and keep track of how may items are actually in it. or C. use a vector or list container class.

From what I can tell the agents are not alowed to edit the countries. If you want to keep a list of them for some reason just make a Country[] myCountries = new Country[ n ]; and put them on that. You can't edit the country themselves but you can edit a array of pointers to counties which is how java handles things.

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

Post by dustin » Tue Jan 04, 2005 7:18 am

The provided Country.java and Card.java are stub files. They only exists to allow you to compile your agents.

Post Reply