#include "common/basesystemenv.h"
#include "common/GeneratorEnvInit.h"
namespace
{
class Tutorial_Generation_CellBox : public BaseSystemEnv
{
public:
typedef GeneratorEnvInit InitClass;
public:
bool GenerateMultisector(bool useCellBox)
{
std::string sectorName = (useCellBox ? "Village_A" : "Village_A_noCellBox");
Kaim::Ptr<Kaim::GeneratorSector> sectorA = *KY_NEW
Kaim::GeneratorSector(KyGlue::DefaultGuidGeneratorInterface::GenerateGuid(), sectorName.c_str());
sectorA->
m_inputFileNames.PushBack(GetAbsoluteInputFileName(
"common/Village_250x200_multisector/Village_250x200_Sector_A.obj").c_str());
sectorName = (useCellBox ? "Village_B" : "Village_B_noCellBox");
Kaim::Ptr<Kaim::GeneratorSector> sectorB = *KY_NEW
Kaim::GeneratorSector(KyGlue::DefaultGuidGeneratorInterface::GenerateGuid(), sectorName.c_str());
sectorB->
m_inputFileNames.PushBack(GetAbsoluteInputFileName(
"common/Village_250x200_multisector/Village_250x200_Sector_B.obj").c_str());
sectorName = (useCellBox ? "Village_C" : "Village_C_noCellBox");
Kaim::Ptr<Kaim::GeneratorSector> sectorC = *KY_NEW
Kaim::GeneratorSector(KyGlue::DefaultGuidGeneratorInterface::GenerateGuid(), sectorName.c_str());
sectorC->
m_inputFileNames.PushBack(GetAbsoluteInputFileName(
"common/Village_250x200_multisector/Village_250x200_Sector_C.obj").c_str());
sectorName = (useCellBox ? "Village_D" : "Village_D_noCellBox");
Kaim::Ptr<Kaim::GeneratorSector> sectorD = *KY_NEW
Kaim::GeneratorSector(KyGlue::DefaultGuidGeneratorInterface::GenerateGuid(), sectorName.c_str());
sectorD->
m_inputFileNames.PushBack(GetAbsoluteInputFileName(
"common/Village_250x200_multisector/Village_250x200_Sector_D.obj").c_str());
if (useCellBox)
{
}
return false;
for (
KyUInt32 i = 0; i < sectorStats.
GetCount(); ++i)
sizeOfOverlapData += sectorStats[i].m_overlapDataSizeInBytes;
if (!useCellBox)
KY_LOG_MESSAGE(("Generation with no cellBox: %i bytes of overlap data", sizeOfOverlapData));
else
KY_LOG_MESSAGE(("Generation with cellBox: %i bytes of overlap data", sizeOfOverlapData));
return true;
}
};
#define TEST_ENV_CLASS Tutorial_Generation_CellBox
TEST_ENV {}
TUTORIAL { CHECK(env.GenerateMultisector(false)) }
TUTORIAL { CHECK(env.GenerateMultisector(true)) }
}