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: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: can_player_build_air_units_at_all
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Fri, 1 Mar 2002 15:28:59 +0000 (GMT)

On Thu, 28 Feb 2002, Raimar Falke wrote:

> On Thu, Feb 28, 2002 at 05:50:51PM +0000, Gregory Berkolaiko 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
> > 4. New technology flag: "Flying"
> 
> In update_research:
>  pplayer->ai.player_can_build_air_units = FALSE
>  for all unit types:
>    if can build unit type and unit type is air unit:
>      pplayer->ai.player_can_build_air_units = TRUE

Aye, but what should trigger changing ai.player_can_build_air_units from 
FALSE to TRUE?  Discovery of Flight?  

Discovery of the first technology to enable flying units is an ugly 
criterium as it would involve unit_iterate every time a discovery is made 
(although this is how help text functions).

I would prefer a special flag, but it would assume certain ruleset 
self-consistency...

G.




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