Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11639) generalization of output types in city_support
Home

[Freeciv-Dev] (PR#11639) generalization of output types in city_support

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11639) generalization of output types in city_support
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Dec 2004 12:41:17 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11639 >

This patch replaces the hard-coded handling of food, shield, and gold
upkeep for units in city_support() with a loop.  This makes things
simpler and (in theory) more extensible.  It also potentially makes them
slower since we loop over all output types.  In my brief testing this
didn't make a measurable difference but it should be examined a little
more closely.  Note that someday we will disable the upkeep checks for
refreshes called from the CM so this code won't be a bottleneck at all.

You might think from this code that you could put science/trade/luxury
upkeep into the rulesets and it would work.  Well, you might be right. 
I haven't tested this but I know there would be some problems with it. 
Obviously there aren't any graphics or GUI support at all for other
types of upkeep.  And many of the luxury/science/trade checks are done
on the total production rather than on the surplus (basically, assuming
the usage is 0).  So it may work but will certainly not be perfect.

-jason

Attachment: upkeep.diff
Description: Binary data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11639) generalization of output types in city_support, Jason Short <=