Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: can_player_build_air_units_at_all
Home

[Freeciv-Dev] Re: can_player_build_air_units_at_all

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: can_player_build_air_units_at_all
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Fri, 1 Mar 2002 02:23:30 -0800 (PST)

--- Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx> wrote:
> Hi,
> 
> My air units AI seems to be working now (minor problems left to fix), but 
> I need the above function so I can skip all air calculations if they are 
> unnecessary.  I need your advice here.
> As I see it there are several possibilities:
> 1. The ugly kludge I use: 
> player_knows_improvement_tech(pplayer, B_AIRPORT)
> 2. Even worse: hardcoded check for technology with name Flight...
> 3. New variable in game.rtech

There should already be a flying tech in game.rtech.

> 4. New technology flag: "Flying"
> 

There is also the option of get_invention 

int get_invention(struct player *plr, int tech)
 {
 if(!tech_exists(tech))
 return TECH_UNKNOWN;
 return plr->research.inventions[tech];
 }

 get_invention(plr, advances[i].req[0])==TECH_KNOWN 




> Probably the best solution would involve a mix of 3 and 4.  Please help me 
> out here, I am not very experienced with all these 
> flags/ruleset parsing/generalised techs things :((
> 
> Best,
> G.
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com


[Prev in Thread] Current Thread [Next in Thread]