[Freeciv-Dev] Re: (PR#8906) save shuffled_players
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8906 >
On Sun, 6 Jun 2004, Jason Short wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8906 >
>
> Gregory Berkolaiko wrote:
>
> >>>Anyway, your patch is a step in right direction. Is set_shuffled_players
> >>>used more than once? I think you should kill it. Set the players as you
> >>>load them.
> >>
> >>This is possible but it means the shuffled players variables must be
> >>made global (currently they are static). I preferred to just add a new
> >>function to the interface. But I can do it the other way if you like.
> >>Is it worth it?
> >
> > Ah, I see. No, definitely not worth it. Although you could make a
> > smaller function set_shuffled_player to set just one player and call it in
> > the loop, I think this is worth it. And definitely write in the header of
> > the function that it is essentially an accessor to the static variables.
>
> This is possible (patch attached). Only problem with this is with
> shuffled_nplayers. This is set when the players are shuffled so that if
> the number of players change they'll be reshuffled (although I suspect
> this is impossible). In theory it's like a boolean "is_shuffled" value.
>
> And if we set values one at a time we could end up with only some
> positions shuffled, while shuffled_nplayers has been set (since of
> course we have to set it on _every_ call to set_shuffled_player).
Ok, you choose the patch. They are both almost equally bad ;)
|
|