[Freeciv-Dev] Re: [FreeCiv-Cvs] nb: Robert Brady <rwb197@xxxxxxxxxx> has
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
Reinier Post wrote:
> There are several counts of the numbers of barbarians in the code already.
> These could be replaced with mentions of game.nbarbarians now.
> 
> Why wasn't game.nbarbarians introduced before?  Just coincidence,
> or a design criterion I am not aware of?
Just guessing, but it could be considered easier and safer to
simply go through game.players[] and count how many are barbarians.
That is, easy because it is a relatively small counting operation, 
and safer because counting avoids the possibility of any inconsistency 
between game.nbarbarians and the _real_ count of how many players 
satisfy is_barbarian(pplayer).
-- David
 
 
 
 | 
 |