2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
// AnvilStats.cpp
|
|
|
|
|
|
|
|
// Implements the main app entrypoint
|
|
|
|
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "Processor.h"
|
|
|
|
#include "Statistics.h"
|
|
|
|
#include "BiomeMap.h"
|
|
|
|
#include "HeightMap.h"
|
2013-08-30 17:32:27 -04:00
|
|
|
#include "HeightBiomeMap.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
#include "ChunkExtract.h"
|
|
|
|
#include "SpringStats.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char * argv[])
|
|
|
|
{
|
|
|
|
if (argc < 2)
|
|
|
|
{
|
|
|
|
LOG("Usage: %s <method number> [<world folder>]", argv[0]);
|
|
|
|
LOG("Available methods:");
|
|
|
|
LOG(" 0 - statistics");
|
|
|
|
LOG(" 1 - biome map");
|
|
|
|
LOG(" 2 - height map");
|
|
|
|
LOG(" 3 - extract chunks");
|
|
|
|
LOG(" 4 - count lava- and water- springs");
|
2013-08-30 17:32:27 -04:00
|
|
|
LOG(" 5 - biome and height map");
|
2013-07-29 07:13:03 -04:00
|
|
|
LOG("\nNo method number present, aborting.");
|
|
|
|
return -1;
|
|
|
|
}
|
2017-12-23 07:49:08 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
AString WorldFolder;
|
|
|
|
if (argc > 2)
|
|
|
|
{
|
|
|
|
WorldFolder = argv[2];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WorldFolder = "." + cFile::PathSeparator;
|
|
|
|
}
|
2017-12-23 07:49:08 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
cCallbackFactory * Factory = NULL;
|
|
|
|
switch (atol(argv[1]))
|
|
|
|
{
|
|
|
|
case 0: Factory = new cStatisticsFactory; break;
|
|
|
|
case 1: Factory = new cBiomeMapFactory; break;
|
|
|
|
case 2: Factory = new cHeightMapFactory; break;
|
|
|
|
case 3: Factory = new cChunkExtractFactory(WorldFolder); break;
|
|
|
|
case 4: Factory = new cSpringStatsFactory; break;
|
2013-08-30 17:32:27 -04:00
|
|
|
case 5: Factory = new cHeightBiomeMapFactory; break;
|
2013-07-29 07:13:03 -04:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
LOG("Unknown method \"%s\", aborting.", argv[1]);
|
|
|
|
return -2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cProcessor Processor;
|
|
|
|
Processor.ProcessWorld(WorldFolder, *Factory);
|
2017-12-23 07:49:08 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
LOG("Processing finished");
|
2017-12-23 07:49:08 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
delete Factory;
|
2017-12-23 07:49:08 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
LOG("Done");
|
|
|
|
}
|