[Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player b
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
freeciv-dev@xxxxxxxxxxx (Freeciv developers) |
Subject: |
[Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug) |
From: |
Reinier Post <rp@xxxxxxxxxx> |
Date: |
Wed, 17 May 2000 13:47:57 +0200 |
> OTOH, it's not clear to me why you need to re-order the players ever
> --- if a player is removed, and that leaves a 'hole' in the player
> array indexes, does that matter?
The Freeciv code does not yet attempt to hide the game struct.
Iterations over players are always written out, like this:
for (plrnum=0; plrnum<game.nplayers; ++plrnum) {
struct player *pplayer = &game.player[plrnum];
[...]
}
Standard access operators can be written in game.h, to iterate over
game.players, and to add/remove elements. A C++ version would have
had this abstraction from the start, but in C we can make do with macros.
--
Reinier
- [Freeciv-Dev] FoW remove player bug, Thue Janus Kristensen, 2000/05/16
- [Freeciv-Dev] somebody fix struct *player! (was: FoW remove player bug), Reinier Post, 2000/05/16
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/16
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), David Pfitzner, 2000/05/16
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Reinier Post, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Reinier Post, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Jules Bean, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug),
Reinier Post <=
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Jules Bean, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Mika Korhonen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Mika Korhonen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Robert Brady, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Daniel Burrows, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Jed Davis, 2000/05/19
|
|