2012-09-27 16:02:25 -04:00
|
|
|
|
|
|
|
// AnvilStats.cpp
|
|
|
|
|
|
|
|
// Implements the main app entrypoint
|
|
|
|
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "Processor.h"
|
2012-09-29 15:01:05 -04:00
|
|
|
#include "Statistics.h"
|
|
|
|
#include "BiomeMap.h"
|
2013-01-22 01:49:14 -05:00
|
|
|
#include "HeightMap.h"
|
2012-09-27 16:02:25 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char * argv[])
|
|
|
|
{
|
|
|
|
if (argc < 2)
|
|
|
|
{
|
|
|
|
LOG("Usage: %s <method number> [<world folder>]", argv[0]);
|
2012-09-29 15:01:05 -04:00
|
|
|
LOG("Available methods:");
|
|
|
|
LOG(" 0 - statistics");
|
|
|
|
LOG(" 1 - biome map");
|
2013-01-22 01:49:14 -05:00
|
|
|
LOG(" 2 - height map");
|
2012-09-27 16:02:25 -04:00
|
|
|
LOG("\nNo method number present, aborting.");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
AString WorldFolder;
|
|
|
|
if (argc > 2)
|
|
|
|
{
|
|
|
|
WorldFolder = argv[2];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WorldFolder = "." + cFile::PathSeparator;
|
|
|
|
}
|
|
|
|
|
|
|
|
cCallbackFactory * Factory = NULL;
|
|
|
|
switch (atol(argv[1]))
|
|
|
|
{
|
|
|
|
case 0: Factory = new cStatisticsFactory; break;
|
2012-09-29 15:01:05 -04:00
|
|
|
case 1: Factory = new cBiomeMapFactory; break;
|
2013-01-22 01:49:14 -05:00
|
|
|
case 2: Factory = new cHeightMapFactory; break;
|
2012-09-27 16:02:25 -04:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
LOG("Unknown method \"%s\", aborting.", argv[1]);
|
|
|
|
return -2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cProcessor Processor;
|
|
|
|
Processor.ProcessWorld(WorldFolder, *Factory);
|
|
|
|
|
2012-10-04 08:07:06 -04:00
|
|
|
LOG("Processing finished");
|
|
|
|
|
2012-09-27 16:02:25 -04:00
|
|
|
delete Factory;
|
|
|
|
|
|
|
|
LOG("Done");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|