[Freeciv-Dev] Re: [FreeCiv-Cvs] thue: Move the seen field from the commo
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
freeciv-dev@xxxxxxxxxxx |
Subject: |
[Freeciv-Dev] Re: [FreeCiv-Cvs] thue: Move the seen field from the common map to the... |
From: |
Thue Janus Kristensen <thue@xxxxxxx> |
Date: |
Sat, 20 May 2000 13:02:50 +0200 |
> > I don't think there is any real efficiency argument, since it is
> > very simple to transform in either direction between pplayer and
> > playerid.
> >
> > And the programmer convenience issue is relatively small, since it
> > is trivial to do pplayer->player_no (hmm, that should be player_num
> > IMO), or get_player(playerid) (which could be macro if wanted).
> >
> > So I think the "standard" should be to pick the one which is more
> > "natural"/useful in most cases, and use that except where there is
> > clear reason to prefer the other. To me this means the standard
> > should be pplayer. Though I suspect Thue has been doing lots of
> > stuff outside the player struct recenty, so finds playerid more
> > natural... But still I think most cases this can be hidden
> > inside the map etc functions rather than having patches with lots
> > of changes where the caller has do the change, as:
> > - else if( map_get_known_and_seen(xu, yu, victim) )
> > + else if( map_get_known_and_seen(xu, yu, victim->player_no) )
>
> Actually most of the time you don't need one fo the other, but need only
> to compare two players, and either will do.
> Since units and cities identify their owners with playerids, it
> actually seemed to me to be easier to use playerids most of the time.
> But we could make units and cities have player pointers in their
> structs... (talk about big conversions...)
> I also argued that the only need for the identification at the low level
> was for indices in bitvectors, which actually gives a preference for
> playerids
On second though - it would be quite nice and preferable if the units and
cities had player pointers... Will you make the patch? :P
-Thue
|
|