[Freeciv-Dev] Re: small GUI unification: decrease_unit_hp_smooth (PR#109
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Dec 13, 2001 at 11:22:55AM -0500, Jason Short wrote:
> Raimar Falke wrote:
>
> > On Fri, Dec 07, 2001 at 11:36:31AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx
> > wrote:
> >
> >>This small unification cuts off part of decrease_unit_hp_smooth (a
> >>gui-specific function). It creates a new function, decrease_unit_hp,
> >>that takes care of the common case where do_combat_animation is turned
> >>off, and only calls decrease_unit_hp_smooth if combat animation is enable.
> >>
> >>It also adds comments for all these functions - including the GUI stub
> >>function. I think having comments for the GUI stub functions is
> >>important, since most of the GUI's just seem to have cut-and-pasted
> >>these functions (thus having to write comments themselves or go without
> >>- usually the latter).
> >>
> >>It's small, but not really related to anything else so here it is all alone.
> >>
> >
> > Applied. I think that even more can be factored out. At least the
> > first do{}while loop looks very similar. And the second part can be
> > wrapped in a show_explosion_animation().
>
> Hmmm. It looks like it could be (although it'd be a bit hairy), but do
> you think that would limit the functionality of different GUI's too
> much? A different GUI _might_ want to use a different system for combat
> animation altogether (although I can't imagine what it would be).
We have a lot of GUIs and all do it the same way. And less code means
less maintenance.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Any sufficiently advanced technology is indistinguishable from magic."
-- Arthur C. Clarke
|
|