| 339 | |
| 340 | |
| 341 | void cStatisticsFactory::SaveBiomes(void) |
| 342 | { |
| 343 | cFile f; |
| 344 | if (!f.Open("Biomes.xls", cFile::fmWrite)) |
| 345 | { |
| 346 | LOG("Cannot write to file Biomes.xls. Statistics not written."); |
| 347 | return; |
| 348 | } |
| 349 | double TotalColumns = (double)(m_CombinedStats.m_BiomeNumChunks) * 16 * 16 / 100; // Total number of columns processed; convert into percent |
| 350 | if (TotalColumns < 1) |
| 351 | { |
| 352 | // Avoid division by zero |
| 353 | TotalColumns = 1; |
| 354 | } |
| 355 | for (int i = 0; i <= 255; i++) |
| 356 | { |
| 357 | AString Line; |
| 358 | Printf(Line, "%s\t%d\t%llu\t%.05f\n", GetBiomeString(i), i, m_CombinedStats.m_BiomeCounts[i], ((double)(m_CombinedStats.m_BiomeCounts[i])) / TotalColumns); |
| 359 | f.Write(Line.c_str(), Line.length()); |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | |
| 364 | |