Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: [FreeCiv-Cvs] nb: Robert Brady <rwb197@xxxxxxxxxx> has
Home

[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]
To: rp@xxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [FreeCiv-Cvs] nb: Robert Brady <rwb197@xxxxxxxxxx> has reported th...
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Mon, 15 May 2000 17:43:43 +1000 (EST)

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



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