here's my computation to calculate miners/pumps this should work.
Code:
double[] collector_max = { 500, 1000, 1500, 2500, 10000, 20000, 30000, 50000, 75000, 100000, 150000, 200000 };
double[] collector_ph = { 200, 400, 600, 800, 1000, 1300, 1600, 1900, 2200, 2500, 3000, 3500 };
foreach (var B in _b.buildings)
{
int _lvl = B.lvl; // Collector level..
var _collectedtime = B.res_time;
var _timedif = (collector_max[_lvl] / collector_ph[_lvl] * 3600) - _collectedtime ;
var _collectedres = (_timedif * (collector_ph[_lvl] / 3600));
if (B.data == 1000002){ // elixir pump
Total_elix += (double)(_collectedres);
}
if (B.data == 1000004)
{ // Gold Mine
Total_Gold += (double)(_collectedres);
}
}