Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_c
Home

[Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_cost
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 13 Jan 2004 01:18:28 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Mon, Jan 12, 2004 at 02:57:13PM -0800, James Canete wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7236 >
> 
> I've removed quite a lot of the direct references to the build_cost
> values in unit_type and impr_type, and redirected them to value
> functions, which replace unit_value() and improvement_value().
> 
> I've made them into unit_build_value(), unit_buy_value(), 
> unit_disband_value(), improvement_build_value(),
> improvement_buy_value(), and improvement_sell_value().
> 
> Why?  Because I want to be able to easily change a couple of the
> hardcoded values which are dependent on the build_cost value for units
> and improvements, for instance gold per shield when rushing
> production,
> or number of shields for disbanding.  Mostly because I want to
> implement accelerated production. :)
> 
> This patch is far from complete; I've changed pretty much every
> reference that I could with a small awk script, and the rest I have to
> change manually.  And since I only used a quick swap to 
> unit_build_value() and improvement_build_value(), I also have to step
> through all of my changes, changing them to references to the other
> four functions.
> 
> Here's the patch so far.  Savegames match, and the new version takes
> 1m16.870s seconds in an autogame, as opposed to the original CVS
> taking
> 1m16.540s.  This is probably attibutable to accesses now going through
> a function, and could be fixed by changing the functions into macros.
> 
> But I don't want to get into THAT argument.  :)

Mike: how much does this clash with gen-effects?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Sit, disk, sit. Good boy. Now spin up. Very good. Here's a netscape
  cookie for you. Fetch me some data. Come on, you can do it. No, not that
  data. Bad disk. Bad." 
    -- Calle Dybedahl, alt.sysadmin.recovery




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