This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calculating net material production


Lincoln Peters wrote:

Is there any code already in place to track such statistics?  Or will I
have to perform deeper code surgery to do this?

I think there is already something that sums up total materials possessed by a side. It is used in the materials display beneath the units type list in the Tcl/Tk interface. If the basic calculation behind this is not already in the kernel, then it could probably be moved there, and you could call it at the end of each turn and update some arrays (of length 'nummtypes') that would allow you to maintain a running average of the rates of production:
m_prod_avg[m] += (m_at_turn_end[m] - m_at_last_turn_end[m]) / 2;
or something like that.


Eric


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]