Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#2521) general effects framework
Home

[Freeciv-Dev] Re: (PR#2521) general effects framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2521) general effects framework
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2004 20:16:03 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=2521 >

On Tue, 20 Apr 2004, Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=2521 >
>
> On the topic of effects-pre:
>
> - I don't understand why there is a game.can_xxx and also a
> pplayer->can_nuke.
>
> - I don't understand why can_xxx is needed when we could just check
> game.global_wonders[id] (where id is determined by some flag).  Is it
> because the effect need not always come from a wonder?

This seem like a reasonable assumption. It makes no sense to check for a
specific building if you are doing things from an effect centric
perspective. However, I think we should use a bitvector of global effects
here. Sort of like the unit flags, rather than having zillions of
different struct fields, one per effect.

> But anyway...
>
> This patch is an "update" of effects-pre8 that hopefully makes these
> values work.  I haven't tested it.
>
> - game.can_xxx is kept and is actually sent to the client.
>
> - pplayer->can_xxx is removed.
>
> - game.can_xxx is set when the appropriate wonders are built (eventually
> this should be a flag or effect; for now it's just hard-coded to the
> enumerated value).
>
> - game.can_xxx is checked instead of checking for the existance of those
> wonders.
>
> - Savegame backwards compatability is added.  If the appropriate
> capability isn't set the game checks game.global_wonders to find out if
> the appropriate wonders have been built.
>
> As a side note, the savegame capstring is pretty long.  Since we rarely
> break savegame compatability it will probably continue to grow.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa






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