Positions for Geothermal Plants

Positions for Geothermal Plants

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Positions for Geothermal Plants

Post by abma »

Hi!

How can i get locations for Geothermal plants through the Java-Interface?
Map.getResourceMapSpotsPositions(Resource=energy) doesn't work...

The only idea i had, was try and error...
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Positions for Geothermal Plants

Post by abma »

Found it myself:



(Pseudo-Code:)

Code: Select all

List<Feature> f=OOAICallback.getFeatures()
for (int i=0; i<f.size(); i++){ 
	if (f.get(i).getDef().isGeoThermal()){
            ...
	}
}
User avatar
LoidThanead
Posts: 58
Joined: 27 Feb 2008, 16:16

Re: Positions for Geothermal Plants

Post by LoidThanead »

Thanks for posting the solution. I can use this. :)
Post Reply

Return to “AI”