#include <generatorinputoutput.h>
The GeneratorInputOutput class is a central element of the generation.
Its purpose is to setup a generation as well as store the data that have been produced.
GeneratorInputOutput contains 3 types of information: - the Actions: what to generate in the next call to Generator::Generate(). By default, everything is generated from scratch, but it's possible to setup iterative generations.
Inherits Kaim::RefCountBaseNTS< C, Stat >.
Public Member Functions | |
GeneratorInputOutput () | |
void | Clear () |
Public Attributes | |
DatabaseDescriptor | m_databaseDescriptor |
Save, Load, Copy, Clear Functions | |
KyResult | Save (const char *fullFileName, FileOpenerBase *fileOpener=0) const |
KyResult | Load (const char *fullFileName, FileOpenerBase *fileOpener=0) |
Add/Remove/Set Functions | |
void | SetSectorChangeForAllSectors (GenFlags::SectorChange sectorChange) |
void | SetInputSourceForAllSectors (GenFlags::SectorInputSource inputSource) |
KyResult | AddSector (Ptr< GeneratorSector > sector) |
void | AddExclusiveGuids (const KyGuid *guids, KyUInt32 guidsCount) |
void | AddExclusiveGuids (const GeneratorGuidCompound &generatorGuidCompound) |
Accessors | |
KyUInt32 | GetSectorCount () const |
Ptr< GeneratorSector > | GetSectorWithIndex (KyUInt32 index) |
Ptr< GeneratorSector > | GetSectorWithName (const char *name) |
Ptr< GeneratorSector > | GetSectorWithGuid (const KyGuid &guid) |
const Ptr< GeneratorSector > | GetSectorWithIndex (KyUInt32 index) const |
const Ptr< GeneratorSector > | GetSectorWithName (const char *name) const |
const Ptr< GeneratorSector > | GetSectorWithGuid (const KyGuid &guid) const |
Kaim::GeneratorInputOutput::GeneratorInputOutput | ( | ) |
constructor
Specifies the GUIDs of sectors that cover the same areas of terrain, but that will never be loaded into the same Database at the same time.
This prevents the NavData generation system from generating alternative data in the area of overlap.
This is primarily intended to support swappable sectors, which reflect multiple versions of the terrain in a single area – for example, one version of a sector that contains a building, and another version of a sector in which the building has been destroyed.
You can still use swappable sectors without calling this method. However, as the alternative data generated in the area of overlap between the sectors will never be used, you can reduce the size of your NavData by preventing the NavData generation system from generating the data in the first place.
guids | An array of GUIDs that identify the sectors that will never be loaded into the same Database at the same time. |
guidsCount | The number of elements in the guids array. |
KyResult Kaim::GeneratorInputOutput::AddSector | ( | Ptr< GeneratorSector > | sector | ) |
Use this function to Add new GeneratorSector to the list stored in the GeneratorInputOutput.
This function returns KY_ERROR if a sector with the same name or GUID is already in the sector list.
void Kaim::GeneratorInputOutput::Clear | ( | ) |
Reset members as if the object was freshly constructed.
KyUInt32 Kaim::GeneratorInputOutput::GetSectorCount | ( | ) | const |
Returns the sector count.
Ptr<GeneratorSector> Kaim::GeneratorInputOutput::GetSectorWithGuid | ( | const KyGuid & | guid | ) |
Returns the Sector with guid if it exists, non const version.
const Ptr<GeneratorSector> Kaim::GeneratorInputOutput::GetSectorWithGuid | ( | const KyGuid & | guid | ) | const |
Returns the Sector with guid if it exists, const version.
Ptr<GeneratorSector> Kaim::GeneratorInputOutput::GetSectorWithIndex | ( | KyUInt32 | index | ) |
Returns the Sector at index if it exists, non const version.
const Ptr<GeneratorSector> Kaim::GeneratorInputOutput::GetSectorWithIndex | ( | KyUInt32 | index | ) | const |
Returns the Sector at index if it exists, const version.
Ptr<GeneratorSector> Kaim::GeneratorInputOutput::GetSectorWithName | ( | const char * | name | ) |
Returns the Sector with name if it exists, non const version.
const Ptr<GeneratorSector> Kaim::GeneratorInputOutput::GetSectorWithName | ( | const char * | name | ) | const |
Returns the Sector with name if it exists, const version.
KyResult Kaim::GeneratorInputOutput::Load | ( | const char * | fullFileName, |
FileOpenerBase * | fileOpener = 0 |
||
) |
Load the GeneratorInputOutput from a file.
fullFileName | The filename from where to load the GeneratorInputOutput. |
fileOpener | A custom file opener to access files. By default, if no fileOpener is set, the DefaultFileOpener will be used. |
Note: after a call to Load(), the GeneratorSector m_userData are KY_NULL. you can set it with GetSectorWithGuid()->SetUserData(userData).
KyResult Kaim::GeneratorInputOutput::Save | ( | const char * | fullFileName, |
FileOpenerBase * | fileOpener = 0 |
||
) | const |
Save the GeneratorInputOutput in a file.
fullFileName | The filename where to save the GeneratorInputOutput. |
fileOpener | A custom file opener to access files. By default, if no fileOpener is set, the DefaultFileOpener will be used. |
void Kaim::GeneratorInputOutput::SetInputSourceForAllSectors | ( | GenFlags::SectorInputSource | inputSource | ) |
Set inputSource for all sectors (regular and patches)
void Kaim::GeneratorInputOutput::SetSectorChangeForAllSectors | ( | GenFlags::SectorChange | sectorChange | ) |
Set sectorChange for all sectors (regular and patches)
DatabaseDescriptor Kaim::GeneratorInputOutput::m_databaseDescriptor |
Out The database description.