Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] (PR#8754) effects patch
Home

[Freeciv-Dev] (PR#8754) effects patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8754) effects patch
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Wed, 14 Jul 2004 06:24:49 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8754 >

> [jdorje@xxxxxxxxxxx - Wed Jul 14 04:56:19 2004]:
> 
> Jason Dorje Short wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=8754 >
> > 
> > The ***_direct() functions are way too cryptically named.
> 
> Or to put it another way, what's the difference between 
> can_player_build_improvement_direct ("Whether player can build given 
> improvement somewhere, ignoring whether improvement is obsolete.") and 
> can_player_eventually_build_improvement ("Whether player can 
> _eventually_ build given improvement somewhere -- ie, returns 1 if 
> improvement is available with current tech OR will be available with 
> future tech.  returns 0 if unit is obsolete.")?

can_player_eventually_build_improvement returns TRUE if it may be
possible for the player to build that thing in the future.

can_player_build_improvement_direct returns TRUE if that player can
build that thing *now*.

e.g. the spaceship part checks. You may not be able to build spaceship
parts now because your current spaceship is fully built. But imagine
someone conquers your capital and destroys your spaceship. Then you can
build spaceship parts again.

> What's the difference between can_player_eventually_build_improvement 
> and could_player_eventually_build_improvement?

could_player_eventually_build_improvement was more or less like
can_player_build_improvement_direct.

> Similarly, what's the difference between 
> can_eventually_build_improvement and can_build_improvement_direction?

Same thing as the player functions, except this time you add the city
checks. Is a building already there? Does the city have access to an
ocean square so you can build your harbour in it? etc, etc.

> Obviously these are logically different (except for the "can" versus 
> "could" difference which seems purely semantic).  But why does the user 
> need both?  And how is he supposed to tell which is which?



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