mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
May be breaking build_tdf - Revert "remove all the set but not used testDataValue warnings - coan is a great tool! http://coan2.sourceforge.net/"
This reverts commit fe8b531b42.
This commit is contained in:
+124
-18
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedBattlefieldMarkerObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
@@ -24,20 +24,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedBattlefieldMarkerObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedBattlefieldMarkerObjectTemplate::SharedBattlefieldMarkerObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedBattlefieldMarkerObjectTemplate::SharedBattlefieldMarkerObjectTemplate
|
||||
|
||||
@@ -46,8 +46,8 @@ SharedBattlefieldMarkerObjectTemplate::SharedBattlefieldMarkerObjectTemplate(con
|
||||
*/
|
||||
SharedBattlefieldMarkerObjectTemplate::~SharedBattlefieldMarkerObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedBattlefieldMarkerObjectTemplate::~SharedBattlefieldMarkerObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -104,12 +104,22 @@ Tag SharedBattlefieldMarkerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
int SharedBattlefieldMarkerObjectTemplate::getNumberOfPoles() const
|
||||
int SharedBattlefieldMarkerObjectTemplate::getNumberOfPoles(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getNumberOfPoles(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_numberOfPoles.isLoaded())
|
||||
@@ -149,16 +159,31 @@ int SharedBattlefieldMarkerObjectTemplate::getNumberOfPoles() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getNumberOfPoles
|
||||
|
||||
int SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMin() const
|
||||
int SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getNumberOfPolesMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_numberOfPoles.isLoaded())
|
||||
@@ -198,16 +223,31 @@ int SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMin
|
||||
|
||||
int SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMax() const
|
||||
int SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getNumberOfPolesMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_numberOfPoles.isLoaded())
|
||||
@@ -247,16 +287,31 @@ int SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getNumberOfPolesMax
|
||||
|
||||
float SharedBattlefieldMarkerObjectTemplate::getRadius() const
|
||||
float SharedBattlefieldMarkerObjectTemplate::getRadius(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getRadius(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_radius.isLoaded())
|
||||
@@ -296,16 +351,31 @@ float SharedBattlefieldMarkerObjectTemplate::getRadius() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getRadius
|
||||
|
||||
float SharedBattlefieldMarkerObjectTemplate::getRadiusMin() const
|
||||
float SharedBattlefieldMarkerObjectTemplate::getRadiusMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getRadiusMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_radius.isLoaded())
|
||||
@@ -345,16 +415,31 @@ float SharedBattlefieldMarkerObjectTemplate::getRadiusMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getRadiusMin
|
||||
|
||||
float SharedBattlefieldMarkerObjectTemplate::getRadiusMax() const
|
||||
float SharedBattlefieldMarkerObjectTemplate::getRadiusMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getRadiusMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_radius.isLoaded())
|
||||
@@ -394,10 +479,29 @@ float SharedBattlefieldMarkerObjectTemplate::getRadiusMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getRadiusMax
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedBattlefieldMarkerObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getNumberOfPolesMin(true));
|
||||
IGNORE_RETURN(getNumberOfPolesMax(true));
|
||||
IGNORE_RETURN(getRadiusMin(true));
|
||||
IGNORE_RETURN(getRadiusMax(true));
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedBattlefieldMarkerObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -406,8 +510,8 @@ float SharedBattlefieldMarkerObjectTemplate::getRadiusMax() const
|
||||
*/
|
||||
void SharedBattlefieldMarkerObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedBattlefieldMarkerObjectTemplate_tag)
|
||||
{
|
||||
@@ -417,7 +521,7 @@ void SharedBattlefieldMarkerObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -437,8 +541,10 @@ void SharedBattlefieldMarkerObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 1))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,1))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -464,4 +570,4 @@ void SharedBattlefieldMarkerObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedBattlefieldMarkerObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+11
-6
@@ -44,13 +44,18 @@ public:
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
int getNumberOfPoles() const;
|
||||
int getNumberOfPolesMin() const;
|
||||
int getNumberOfPolesMax() const;
|
||||
float getRadius() const;
|
||||
float getRadiusMin() const;
|
||||
float getRadiusMax() const;
|
||||
int getNumberOfPoles(bool testData = false) const;
|
||||
int getNumberOfPolesMin(bool testData = false) const;
|
||||
int getNumberOfPolesMax(bool testData = false) const;
|
||||
float getRadius(bool testData = false) const;
|
||||
float getRadiusMin(bool testData = false) const;
|
||||
float getRadiusMax(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+57
-13
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedBuildingObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedBuildingObjectTemplate::SharedBuildingObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedBuildingObjectTemplate::SharedBuildingObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedBuildingObjectTemplate::SharedBuildingObjectTemplate(const std::string & f
|
||||
*/
|
||||
SharedBuildingObjectTemplate::~SharedBuildingObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedBuildingObjectTemplate::~SharedBuildingObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,12 +103,22 @@ Tag SharedBuildingObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedBuildingObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
const std::string & SharedBuildingObjectTemplate::getTerrainModificationFileName() const
|
||||
const std::string & SharedBuildingObjectTemplate::getTerrainModificationFileName(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBuildingObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBuildingObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getTerrainModificationFileName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_terrainModificationFileName.isLoaded())
|
||||
@@ -126,16 +136,31 @@ const std::string & SharedBuildingObjectTemplate::getTerrainModificationFileName
|
||||
}
|
||||
|
||||
const std::string & value = m_terrainModificationFileName.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBuildingObjectTemplate::getTerrainModificationFileName
|
||||
|
||||
const std::string & SharedBuildingObjectTemplate::getInteriorLayoutFileName() const
|
||||
const std::string & SharedBuildingObjectTemplate::getInteriorLayoutFileName(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBuildingObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBuildingObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getInteriorLayoutFileName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_interiorLayoutFileName.isLoaded())
|
||||
@@ -153,10 +178,27 @@ const std::string & SharedBuildingObjectTemplate::getInteriorLayoutFileName() co
|
||||
}
|
||||
|
||||
const std::string & value = m_interiorLayoutFileName.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedBuildingObjectTemplate::getInteriorLayoutFileName
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedBuildingObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getTerrainModificationFileName(true));
|
||||
IGNORE_RETURN(getInteriorLayoutFileName(true));
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedBuildingObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -165,8 +207,8 @@ const std::string & SharedBuildingObjectTemplate::getInteriorLayoutFileName() co
|
||||
*/
|
||||
void SharedBuildingObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedBuildingObjectTemplate_tag)
|
||||
{
|
||||
@@ -176,7 +218,7 @@ void SharedBuildingObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -196,8 +238,10 @@ void SharedBuildingObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 1))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,1))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -223,4 +267,4 @@ void SharedBuildingObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedBuildingObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+7
-2
@@ -44,9 +44,14 @@ public:
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
const std::string & getTerrainModificationFileName() const;
|
||||
const std::string & getInteriorLayoutFileName() const;
|
||||
const std::string & getTerrainModificationFileName(bool testData = false) const;
|
||||
const std::string & getInteriorLayoutFileName(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedCellObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedCellObjectTemplate::SharedCellObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedCellObjectTemplate::SharedCellObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedCellObjectTemplate::SharedCellObjectTemplate(const std::string & filename)
|
||||
*/
|
||||
SharedCellObjectTemplate::~SharedCellObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedCellObjectTemplate::~SharedCellObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedCellObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedCellObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedCellObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedObjectTemplate::testValues();
|
||||
} // SharedCellObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedCellObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedCellObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedCellObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedCellObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedCellObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedCellObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedCellObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedConstructionContractObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedConstructionContractObjectTemplate::SharedConstructionContractObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedConstructionContractObjectTemplate::SharedConstructionContractObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedConstructionContractObjectTemplate::SharedConstructionContractObjectTempla
|
||||
*/
|
||||
SharedConstructionContractObjectTemplate::~SharedConstructionContractObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedConstructionContractObjectTemplate::~SharedConstructionContractObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedConstructionContractObjectTemplate::getHighestTemplateVersion(void) co
|
||||
} // SharedConstructionContractObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedConstructionContractObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedConstructionContractObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedConstructionContractObjectTemplate::getHighestTemplateVersion(void) co
|
||||
*/
|
||||
void SharedConstructionContractObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedConstructionContractObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedConstructionContractObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedConstructionContractObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedConstructionContractObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedConstructionContractObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+734
-62
File diff suppressed because it is too large
Load Diff
+47
-42
@@ -361,10 +361,10 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
Gender getGender() const;
|
||||
Niche getNiche() const;
|
||||
Species getSpecies() const;
|
||||
Race getRace() const;
|
||||
Gender getGender(bool testData = false) const;
|
||||
Niche getNiche(bool testData = false) const;
|
||||
Species getSpecies(bool testData = false) const;
|
||||
Race getRace(bool testData = false) const;
|
||||
float getAcceleration(MovementTypes index) const;
|
||||
float getAccelerationMin(MovementTypes index) const;
|
||||
float getAccelerationMax(MovementTypes index) const;
|
||||
@@ -374,46 +374,51 @@ public:
|
||||
float getTurnRate(MovementTypes index) const;
|
||||
float getTurnRateMin(MovementTypes index) const;
|
||||
float getTurnRateMax(MovementTypes index) const;
|
||||
const std::string & getAnimationMapFilename() const;
|
||||
float getSlopeModAngle() const;
|
||||
float getSlopeModAngleMin() const;
|
||||
float getSlopeModAngleMax() const;
|
||||
float getSlopeModPercent() const;
|
||||
float getSlopeModPercentMin() const;
|
||||
float getSlopeModPercentMax() const;
|
||||
float getWaterModPercent() const;
|
||||
float getWaterModPercentMin() const;
|
||||
float getWaterModPercentMax() const;
|
||||
float getStepHeight() const;
|
||||
float getStepHeightMin() const;
|
||||
float getStepHeightMax() const;
|
||||
float getCollisionHeight() const;
|
||||
float getCollisionHeightMin() const;
|
||||
float getCollisionHeightMax() const;
|
||||
float getCollisionRadius() const;
|
||||
float getCollisionRadiusMin() const;
|
||||
float getCollisionRadiusMax() const;
|
||||
const std::string & getMovementDatatable() const;
|
||||
const std::string & getAnimationMapFilename(bool testData = false) const;
|
||||
float getSlopeModAngle(bool testData = false) const;
|
||||
float getSlopeModAngleMin(bool testData = false) const;
|
||||
float getSlopeModAngleMax(bool testData = false) const;
|
||||
float getSlopeModPercent(bool testData = false) const;
|
||||
float getSlopeModPercentMin(bool testData = false) const;
|
||||
float getSlopeModPercentMax(bool testData = false) const;
|
||||
float getWaterModPercent(bool testData = false) const;
|
||||
float getWaterModPercentMin(bool testData = false) const;
|
||||
float getWaterModPercentMax(bool testData = false) const;
|
||||
float getStepHeight(bool testData = false) const;
|
||||
float getStepHeightMin(bool testData = false) const;
|
||||
float getStepHeightMax(bool testData = false) const;
|
||||
float getCollisionHeight(bool testData = false) const;
|
||||
float getCollisionHeightMin(bool testData = false) const;
|
||||
float getCollisionHeightMax(bool testData = false) const;
|
||||
float getCollisionRadius(bool testData = false) const;
|
||||
float getCollisionRadiusMin(bool testData = false) const;
|
||||
float getCollisionRadiusMax(bool testData = false) const;
|
||||
const std::string & getMovementDatatable(bool testData = false) const;
|
||||
bool getPostureAlignToTerrain(Postures index) const;
|
||||
float getSwimHeight() const;
|
||||
float getSwimHeightMin() const;
|
||||
float getSwimHeightMax() const;
|
||||
float getWarpTolerance() const;
|
||||
float getWarpToleranceMin() const;
|
||||
float getWarpToleranceMax() const;
|
||||
float getCollisionOffsetX() const;
|
||||
float getCollisionOffsetXMin() const;
|
||||
float getCollisionOffsetXMax() const;
|
||||
float getCollisionOffsetZ() const;
|
||||
float getCollisionOffsetZMin() const;
|
||||
float getCollisionOffsetZMax() const;
|
||||
float getCollisionLength() const;
|
||||
float getCollisionLengthMin() const;
|
||||
float getCollisionLengthMax() const;
|
||||
float getCameraHeight() const;
|
||||
float getCameraHeightMin() const;
|
||||
float getCameraHeightMax() const;
|
||||
float getSwimHeight(bool testData = false) const;
|
||||
float getSwimHeightMin(bool testData = false) const;
|
||||
float getSwimHeightMax(bool testData = false) const;
|
||||
float getWarpTolerance(bool testData = false) const;
|
||||
float getWarpToleranceMin(bool testData = false) const;
|
||||
float getWarpToleranceMax(bool testData = false) const;
|
||||
float getCollisionOffsetX(bool testData = false) const;
|
||||
float getCollisionOffsetXMin(bool testData = false) const;
|
||||
float getCollisionOffsetXMax(bool testData = false) const;
|
||||
float getCollisionOffsetZ(bool testData = false) const;
|
||||
float getCollisionOffsetZMin(bool testData = false) const;
|
||||
float getCollisionOffsetZMax(bool testData = false) const;
|
||||
float getCollisionLength(bool testData = false) const;
|
||||
float getCollisionLengthMin(bool testData = false) const;
|
||||
float getCollisionLengthMax(bool testData = false) const;
|
||||
float getCameraHeight(bool testData = false) const;
|
||||
float getCameraHeightMin(bool testData = false) const;
|
||||
float getCameraHeightMax(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+246
-86
@@ -23,24 +23,24 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedDraftSchematicObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedDraftSchematicObjectTemplate::SharedDraftSchematicObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_slotsLoaded(false)
|
||||
, m_slotsAppend(false)
|
||||
, m_attributesLoaded(false)
|
||||
, m_attributesAppend(false)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_slotsLoaded(false)
|
||||
,m_slotsAppend(false)
|
||||
,m_attributesLoaded(false)
|
||||
,m_attributesAppend(false)
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedDraftSchematicObjectTemplate::SharedDraftSchematicObjectTemplate
|
||||
|
||||
@@ -49,7 +49,7 @@ SharedDraftSchematicObjectTemplate::SharedDraftSchematicObjectTemplate(const std
|
||||
*/
|
||||
SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<StructParamOT *>::iterator iter;
|
||||
for (iter = m_slots.begin(); iter != m_slots.end(); ++iter)
|
||||
@@ -68,7 +68,7 @@ SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate()
|
||||
}
|
||||
m_attributes.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ void SharedDraftSchematicObjectTemplate::getSlots(IngredientSlot &data, int inde
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter slots in template %s", DataResource::getName()));
|
||||
return;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -152,10 +152,10 @@ void SharedDraftSchematicObjectTemplate::getSlots(IngredientSlot &data, int inde
|
||||
{
|
||||
int baseCount = base->getSlotsCount();
|
||||
if (index < baseCount)
|
||||
{
|
||||
base->getSlots(data, index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
base->getSlots(data, index);
|
||||
return;
|
||||
}
|
||||
index -= baseCount;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ void SharedDraftSchematicObjectTemplate::getSlotsMin(IngredientSlot &data, int i
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter slots in template %s", DataResource::getName()));
|
||||
return;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -195,10 +195,10 @@ void SharedDraftSchematicObjectTemplate::getSlotsMin(IngredientSlot &data, int i
|
||||
{
|
||||
int baseCount = base->getSlotsCount();
|
||||
if (index < baseCount)
|
||||
{
|
||||
base->getSlotsMin(data, index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
base->getSlotsMin(data, index);
|
||||
return;
|
||||
}
|
||||
index -= baseCount;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ void SharedDraftSchematicObjectTemplate::getSlotsMax(IngredientSlot &data, int i
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter slots in template %s", DataResource::getName()));
|
||||
return;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -238,10 +238,10 @@ void SharedDraftSchematicObjectTemplate::getSlotsMax(IngredientSlot &data, int i
|
||||
{
|
||||
int baseCount = base->getSlotsCount();
|
||||
if (index < baseCount)
|
||||
{
|
||||
base->getSlotsMax(data, index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
base->getSlotsMax(data, index);
|
||||
return;
|
||||
}
|
||||
index -= baseCount;
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ void SharedDraftSchematicObjectTemplate::getAttributes(SchematicAttribute &data,
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attributes in template %s", DataResource::getName()));
|
||||
return;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -305,10 +305,10 @@ void SharedDraftSchematicObjectTemplate::getAttributes(SchematicAttribute &data,
|
||||
{
|
||||
int baseCount = base->getAttributesCount();
|
||||
if (index < baseCount)
|
||||
{
|
||||
base->getAttributes(data, index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
base->getAttributes(data, index);
|
||||
return;
|
||||
}
|
||||
index -= baseCount;
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ void SharedDraftSchematicObjectTemplate::getAttributesMin(SchematicAttribute &da
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attributes in template %s", DataResource::getName()));
|
||||
return;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -349,10 +349,10 @@ void SharedDraftSchematicObjectTemplate::getAttributesMin(SchematicAttribute &da
|
||||
{
|
||||
int baseCount = base->getAttributesCount();
|
||||
if (index < baseCount)
|
||||
{
|
||||
base->getAttributesMin(data, index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
base->getAttributesMin(data, index);
|
||||
return;
|
||||
}
|
||||
index -= baseCount;
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ void SharedDraftSchematicObjectTemplate::getAttributesMax(SchematicAttribute &da
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attributes in template %s", DataResource::getName()));
|
||||
return;
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -393,10 +393,10 @@ void SharedDraftSchematicObjectTemplate::getAttributesMax(SchematicAttribute &da
|
||||
{
|
||||
int baseCount = base->getAttributesCount();
|
||||
if (index < baseCount)
|
||||
{
|
||||
base->getAttributesMax(data, index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
base->getAttributesMax(data, index);
|
||||
return;
|
||||
}
|
||||
index -= baseCount;
|
||||
}
|
||||
|
||||
@@ -434,12 +434,22 @@ size_t SharedDraftSchematicObjectTemplate::getAttributesCount(void) const
|
||||
return count;
|
||||
} // SharedDraftSchematicObjectTemplate::getAttributesCount
|
||||
|
||||
const std::string & SharedDraftSchematicObjectTemplate::getCraftedSharedTemplate() const
|
||||
const std::string & SharedDraftSchematicObjectTemplate::getCraftedSharedTemplate(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCraftedSharedTemplate(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_craftedSharedTemplate.isLoaded())
|
||||
@@ -457,10 +467,26 @@ const std::string & SharedDraftSchematicObjectTemplate::getCraftedSharedTemplate
|
||||
}
|
||||
|
||||
const std::string & value = m_craftedSharedTemplate.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::getCraftedSharedTemplate
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getCraftedSharedTemplate(true));
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedDraftSchematicObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -469,8 +495,8 @@ const std::string & SharedDraftSchematicObjectTemplate::getCraftedSharedTemplate
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedDraftSchematicObjectTemplate_tag)
|
||||
{
|
||||
@@ -480,7 +506,7 @@ void SharedDraftSchematicObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -500,8 +526,10 @@ void SharedDraftSchematicObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 3))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,3))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -563,6 +591,7 @@ void SharedDraftSchematicObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedDraftSchematicObjectTemplate::load
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class SharedDraftSchematicObjectTemplate::_IngredientSlot
|
||||
|
||||
@@ -609,12 +638,22 @@ Tag SharedDraftSchematicObjectTemplate::_IngredientSlot::getId(void) const
|
||||
return _IngredientSlot_tag;
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::getId
|
||||
|
||||
const StringId SharedDraftSchematicObjectTemplate::_IngredientSlot::getName(bool versionOk) const
|
||||
const StringId SharedDraftSchematicObjectTemplate::_IngredientSlot::getName(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
StringId testDataValue = DefaultStringId;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_IngredientSlot * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_IngredientSlot *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_name.isLoaded())
|
||||
@@ -632,16 +671,31 @@ const StringId SharedDraftSchematicObjectTemplate::_IngredientSlot::getName(bool
|
||||
}
|
||||
|
||||
const StringId value = m_name.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::getName
|
||||
|
||||
const std::string & SharedDraftSchematicObjectTemplate::_IngredientSlot::getHardpoint(bool versionOk) const
|
||||
const std::string & SharedDraftSchematicObjectTemplate::_IngredientSlot::getHardpoint(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_IngredientSlot * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_IngredientSlot *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHardpoint(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hardpoint.isLoaded())
|
||||
@@ -659,10 +713,26 @@ const std::string & SharedDraftSchematicObjectTemplate::_IngredientSlot::getHard
|
||||
}
|
||||
|
||||
const std::string & value = m_hardpoint.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::getHardpoint
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::_IngredientSlot::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getName(true));
|
||||
IGNORE_RETURN(getHardpoint(true));
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -671,8 +741,8 @@ const std::string & SharedDraftSchematicObjectTemplate::_IngredientSlot::getHard
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::_IngredientSlot::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
file.enterForm();
|
||||
|
||||
@@ -694,6 +764,7 @@ void SharedDraftSchematicObjectTemplate::_IngredientSlot::load(Iff &file)
|
||||
UNREF(file);
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::load
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class SharedDraftSchematicObjectTemplate::_SchematicAttribute
|
||||
|
||||
@@ -740,12 +811,22 @@ Tag SharedDraftSchematicObjectTemplate::_SchematicAttribute::getId(void) const
|
||||
return _SchematicAttribute_tag;
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::getId
|
||||
|
||||
const StringId SharedDraftSchematicObjectTemplate::_SchematicAttribute::getName(bool versionOk) const
|
||||
const StringId SharedDraftSchematicObjectTemplate::_SchematicAttribute::getName(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
StringId testDataValue = DefaultStringId;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_name.isLoaded())
|
||||
@@ -763,16 +844,31 @@ const StringId SharedDraftSchematicObjectTemplate::_SchematicAttribute::getName(
|
||||
}
|
||||
|
||||
const StringId value = m_name.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::getName
|
||||
|
||||
const StringId SharedDraftSchematicObjectTemplate::_SchematicAttribute::getExperiment(bool versionOk) const
|
||||
const StringId SharedDraftSchematicObjectTemplate::_SchematicAttribute::getExperiment(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
StringId testDataValue = DefaultStringId;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getExperiment(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_experiment.isLoaded())
|
||||
@@ -790,16 +886,31 @@ const StringId SharedDraftSchematicObjectTemplate::_SchematicAttribute::getExper
|
||||
}
|
||||
|
||||
const StringId value = m_experiment.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::getExperiment
|
||||
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValue(bool versionOk) const
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValue(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getValue(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_value.isLoaded())
|
||||
@@ -839,16 +950,31 @@ int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValue(bool versi
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValue
|
||||
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMin(bool versionOk) const
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMin(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getValueMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_value.isLoaded())
|
||||
@@ -888,16 +1014,31 @@ int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMin(bool ve
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMin
|
||||
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMax(bool versionOk) const
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMax(bool versionOk, bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getValueMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_value.isLoaded())
|
||||
@@ -937,10 +1078,28 @@ int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMax(bool ve
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMax
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::_SchematicAttribute::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getName(true));
|
||||
IGNORE_RETURN(getExperiment(true));
|
||||
IGNORE_RETURN(getValueMin(true));
|
||||
IGNORE_RETURN(getValueMax(true));
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -949,8 +1108,8 @@ int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getValueMax(bool ve
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::_SchematicAttribute::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
file.enterForm();
|
||||
|
||||
@@ -978,17 +1137,17 @@ void SharedDraftSchematicObjectTemplate::_SchematicAttribute::load(Iff &file)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const StringId SharedDraftSchematicObjectTemplate::getCraftedName() const
|
||||
const StringId SharedDraftSchematicObjectTemplate::getCraftedName () const
|
||||
{
|
||||
StringId sid = getObjectName();
|
||||
StringId sid = getObjectName ();
|
||||
|
||||
if (sid.isInvalid())
|
||||
if (sid.isInvalid ())
|
||||
{
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate();
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate ();
|
||||
if (sot)
|
||||
{
|
||||
sid = sot->getObjectName();
|
||||
sot->releaseReference();
|
||||
sid = sot->getObjectName ();
|
||||
sot->releaseReference ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,17 +1156,17 @@ const StringId SharedDraftSchematicObjectTemplate::getCraftedName() const
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const StringId SharedDraftSchematicObjectTemplate::getCraftedDetailedDescription() const
|
||||
const StringId SharedDraftSchematicObjectTemplate::getCraftedDetailedDescription () const
|
||||
{
|
||||
StringId sid = getDetailedDescription();
|
||||
StringId sid = getDetailedDescription ();
|
||||
|
||||
if (sid.isInvalid())
|
||||
if (sid.isInvalid ())
|
||||
{
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate();
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate ();
|
||||
if (sot)
|
||||
{
|
||||
sid = sot->getDetailedDescription();
|
||||
sot->releaseReference();
|
||||
sid = sot->getDetailedDescription ();
|
||||
sot->releaseReference ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1016,17 +1175,17 @@ const StringId SharedDraftSchematicObjectTemplate::getCraftedDetailedDescription
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const StringId SharedDraftSchematicObjectTemplate::getCraftedLookAtText() const
|
||||
const StringId SharedDraftSchematicObjectTemplate::getCraftedLookAtText () const
|
||||
{
|
||||
StringId sid = getLookAtText();
|
||||
StringId sid = getLookAtText ();
|
||||
|
||||
if (sid.isInvalid())
|
||||
if (sid.isInvalid ())
|
||||
{
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate();
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate ();
|
||||
if (sot)
|
||||
{
|
||||
sid = sot->getLookAtText();
|
||||
sot->releaseReference();
|
||||
sid = sot->getLookAtText ();
|
||||
sot->releaseReference ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1035,17 +1194,17 @@ const StringId SharedDraftSchematicObjectTemplate::getCraftedLookAtText() const
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const std::string SharedDraftSchematicObjectTemplate::getCraftedAppearanceFilename() const
|
||||
const std::string SharedDraftSchematicObjectTemplate::getCraftedAppearanceFilename () const
|
||||
{
|
||||
const std::string & app = getAppearanceFilename();
|
||||
const std::string & app = getAppearanceFilename ();
|
||||
|
||||
if (app.empty())
|
||||
if (app.empty ())
|
||||
{
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate();
|
||||
const SharedObjectTemplate * const sot = fetchCraftedSharedObjectTemplate ();
|
||||
if (sot)
|
||||
{
|
||||
const std::string capp = sot->getAppearanceFilename();
|
||||
sot->releaseReference();
|
||||
const std::string capp = sot->getAppearanceFilename ();
|
||||
sot->releaseReference ();
|
||||
return capp;
|
||||
}
|
||||
}
|
||||
@@ -1055,18 +1214,19 @@ const std::string SharedDraftSchematicObjectTemplate::getCraftedAppearanceFilena
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const SharedObjectTemplate * SharedDraftSchematicObjectTemplate::fetchCraftedSharedObjectTemplate() const
|
||||
const SharedObjectTemplate * SharedDraftSchematicObjectTemplate::fetchCraftedSharedObjectTemplate () const
|
||||
{
|
||||
const std::string & sotName = getCraftedSharedTemplate();
|
||||
const SharedObjectTemplate * const sot = safe_cast<const SharedObjectTemplate *>(ObjectTemplateList::fetch(sotName.c_str()));
|
||||
const std::string & sotName = getCraftedSharedTemplate ();
|
||||
const SharedObjectTemplate * const sot = safe_cast<const SharedObjectTemplate *>(ObjectTemplateList::fetch (sotName.c_str ()));
|
||||
|
||||
if (!sot)
|
||||
{
|
||||
const char * const draftName = this->DataResource::getName();
|
||||
WARNING(true, ("SharedDraftSchematicObjectTemplate [%s] could not load craftedSharedTemplate [%s]", draftName ? draftName : "", sotName.c_str()));
|
||||
const char * const draftName = this->DataResource::getName ();
|
||||
WARNING (true, ("SharedDraftSchematicObjectTemplate [%s] could not load craftedSharedTemplate [%s]", draftName ? draftName : "", sotName.c_str ()));
|
||||
}
|
||||
|
||||
return sot;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
+23
-8
@@ -109,9 +109,14 @@ protected:
|
||||
virtual Tag getId(void) const;
|
||||
|
||||
public:
|
||||
const StringId getName(bool versionOk) const;
|
||||
const std::string & getHardpoint(bool versionOk) const;
|
||||
const StringId getName(bool versionOk, bool testData = false) const;
|
||||
const std::string & getHardpoint(bool versionOk, bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
@@ -144,12 +149,17 @@ private:
|
||||
virtual Tag getId(void) const;
|
||||
|
||||
public:
|
||||
const StringId getName(bool versionOk) const;
|
||||
const StringId getExperiment(bool versionOk) const;
|
||||
int getValue(bool versionOk) const;
|
||||
int getValueMin(bool versionOk) const;
|
||||
int getValueMax(bool versionOk) const;
|
||||
const StringId getName(bool versionOk, bool testData = false) const;
|
||||
const StringId getExperiment(bool versionOk, bool testData = false) const;
|
||||
int getValue(bool versionOk, bool testData = false) const;
|
||||
int getValueMin(bool versionOk, bool testData = false) const;
|
||||
int getValueMax(bool versionOk, bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
@@ -176,8 +186,13 @@ public:
|
||||
void getAttributesMin(SchematicAttribute &data, int index) const;
|
||||
void getAttributesMax(SchematicAttribute &data, int index) const;
|
||||
size_t getAttributesCount(void) const;
|
||||
const std::string & getCraftedSharedTemplate() const;
|
||||
const std::string & getCraftedSharedTemplate(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedFactoryObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedFactoryObjectTemplate::SharedFactoryObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedFactoryObjectTemplate::SharedFactoryObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedFactoryObjectTemplate::SharedFactoryObjectTemplate(const std::string & fil
|
||||
*/
|
||||
SharedFactoryObjectTemplate::~SharedFactoryObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedFactoryObjectTemplate::~SharedFactoryObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedFactoryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedFactoryObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedFactoryObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedFactoryObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedFactoryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedFactoryObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedFactoryObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedFactoryObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedFactoryObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedFactoryObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedFactoryObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedGroupObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedGroupObjectTemplate::SharedGroupObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedUniverseObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedGroupObjectTemplate::SharedGroupObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedGroupObjectTemplate::SharedGroupObjectTemplate(const std::string & filenam
|
||||
*/
|
||||
SharedGroupObjectTemplate::~SharedGroupObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedGroupObjectTemplate::~SharedGroupObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedGroupObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedGroupObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedGroupObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedUniverseObjectTemplate::testValues();
|
||||
} // SharedGroupObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedGroupObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedGroupObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedGroupObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedGroupObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedGroupObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedGroupObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedGroupObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedGuildObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedGuildObjectTemplate::SharedGuildObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedUniverseObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedGuildObjectTemplate::SharedGuildObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedGuildObjectTemplate::SharedGuildObjectTemplate(const std::string & filenam
|
||||
*/
|
||||
SharedGuildObjectTemplate::~SharedGuildObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedGuildObjectTemplate::~SharedGuildObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedGuildObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedGuildObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedGuildObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedUniverseObjectTemplate::testValues();
|
||||
} // SharedGuildObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedGuildObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedGuildObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedGuildObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedGuildObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedGuildObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedGuildObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedGuildObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedInstallationObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedInstallationObjectTemplate::SharedInstallationObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedInstallationObjectTemplate::SharedInstallationObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedInstallationObjectTemplate::SharedInstallationObjectTemplate(const std::st
|
||||
*/
|
||||
SharedInstallationObjectTemplate::~SharedInstallationObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedInstallationObjectTemplate::~SharedInstallationObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedInstallationObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedInstallationObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedInstallationObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedInstallationObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedInstallationObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedInstallationObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedInstallationObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedInstallationObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedInstallationObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedIntangibleObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedIntangibleObjectTemplate::SharedIntangibleObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedIntangibleObjectTemplate::SharedIntangibleObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedIntangibleObjectTemplate::SharedIntangibleObjectTemplate(const std::string
|
||||
*/
|
||||
SharedIntangibleObjectTemplate::~SharedIntangibleObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedIntangibleObjectTemplate::~SharedIntangibleObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedIntangibleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedIntangibleObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedIntangibleObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedObjectTemplate::testValues();
|
||||
} // SharedIntangibleObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedIntangibleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedIntangibleObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedIntangibleObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedIntangibleObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedIntangibleObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedIntangibleObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedIntangibleObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+23
-12
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedJediManagerObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
@@ -24,20 +24,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedJediManagerObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedJediManagerObjectTemplate::SharedJediManagerObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedUniverseObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedJediManagerObjectTemplate::SharedJediManagerObjectTemplate
|
||||
|
||||
@@ -46,8 +46,8 @@ SharedJediManagerObjectTemplate::SharedJediManagerObjectTemplate(const std::stri
|
||||
*/
|
||||
SharedJediManagerObjectTemplate::~SharedJediManagerObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedJediManagerObjectTemplate::~SharedJediManagerObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -104,6 +104,15 @@ Tag SharedJediManagerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedJediManagerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedJediManagerObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedUniverseObjectTemplate::testValues();
|
||||
} // SharedJediManagerObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -113,8 +122,8 @@ Tag SharedJediManagerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedJediManagerObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedJediManagerObjectTemplate_tag)
|
||||
{
|
||||
@@ -124,7 +133,7 @@ void SharedJediManagerObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -144,8 +153,10 @@ void SharedJediManagerObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -163,4 +174,4 @@ void SharedJediManagerObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedJediManagerObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedManufactureSchematicObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedManufactureSchematicObjectTemplate::SharedManufactureSchematicObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedManufactureSchematicObjectTemplate::SharedManufactureSchematicObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedManufactureSchematicObjectTemplate::SharedManufactureSchematicObjectTempla
|
||||
*/
|
||||
SharedManufactureSchematicObjectTemplate::~SharedManufactureSchematicObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedManufactureSchematicObjectTemplate::~SharedManufactureSchematicObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedManufactureSchematicObjectTemplate::getHighestTemplateVersion(void) co
|
||||
} // SharedManufactureSchematicObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedManufactureSchematicObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedManufactureSchematicObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedManufactureSchematicObjectTemplate::getHighestTemplateVersion(void) co
|
||||
*/
|
||||
void SharedManufactureSchematicObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedManufactureSchematicObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedManufactureSchematicObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedManufactureSchematicObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedManufactureSchematicObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedManufactureSchematicObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedMissionObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedMissionObjectTemplate::SharedMissionObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedMissionObjectTemplate::SharedMissionObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedMissionObjectTemplate::SharedMissionObjectTemplate(const std::string & fil
|
||||
*/
|
||||
SharedMissionObjectTemplate::~SharedMissionObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedMissionObjectTemplate::~SharedMissionObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedMissionObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedMissionObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedMissionObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedMissionObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedMissionObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedMissionObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedMissionObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedMissionObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedMissionObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedMissionObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedMissionObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+629
-79
File diff suppressed because it is too large
Load Diff
@@ -339,41 +339,46 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
const StringId getObjectName() const;
|
||||
const StringId getDetailedDescription() const;
|
||||
const StringId getLookAtText() const;
|
||||
bool getSnapToTerrain() const;
|
||||
ContainerType getContainerType() const;
|
||||
int getContainerVolumeLimit() const;
|
||||
int getContainerVolumeLimitMin() const;
|
||||
int getContainerVolumeLimitMax() const;
|
||||
const std::string & getTintPalette() const;
|
||||
const std::string & getSlotDescriptorFilename() const;
|
||||
const std::string & getArrangementDescriptorFilename() const;
|
||||
const std::string & getAppearanceFilename() const;
|
||||
const std::string & getPortalLayoutFilename() const;
|
||||
const std::string & getClientDataFile() const;
|
||||
float getScale() const;
|
||||
float getScaleMin() const;
|
||||
float getScaleMax() const;
|
||||
GameObjectType getGameObjectType() const;
|
||||
bool getSendToClient() const;
|
||||
float getScaleThresholdBeforeExtentTest() const;
|
||||
float getScaleThresholdBeforeExtentTestMin() const;
|
||||
float getScaleThresholdBeforeExtentTestMax() const;
|
||||
float getClearFloraRadius() const;
|
||||
float getClearFloraRadiusMin() const;
|
||||
float getClearFloraRadiusMax() const;
|
||||
SurfaceType getSurfaceType() const;
|
||||
float getNoBuildRadius() const;
|
||||
float getNoBuildRadiusMin() const;
|
||||
float getNoBuildRadiusMax() const;
|
||||
bool getOnlyVisibleInTools() const;
|
||||
float getLocationReservationRadius() const;
|
||||
float getLocationReservationRadiusMin() const;
|
||||
float getLocationReservationRadiusMax() const;
|
||||
bool getForceNoCollision() const;
|
||||
const StringId getObjectName(bool testData = false) const;
|
||||
const StringId getDetailedDescription(bool testData = false) const;
|
||||
const StringId getLookAtText(bool testData = false) const;
|
||||
bool getSnapToTerrain(bool testData = false) const;
|
||||
ContainerType getContainerType(bool testData = false) const;
|
||||
int getContainerVolumeLimit(bool testData = false) const;
|
||||
int getContainerVolumeLimitMin(bool testData = false) const;
|
||||
int getContainerVolumeLimitMax(bool testData = false) const;
|
||||
const std::string & getTintPalette(bool testData = false) const;
|
||||
const std::string & getSlotDescriptorFilename(bool testData = false) const;
|
||||
const std::string & getArrangementDescriptorFilename(bool testData = false) const;
|
||||
const std::string & getAppearanceFilename(bool testData = false) const;
|
||||
const std::string & getPortalLayoutFilename(bool testData = false) const;
|
||||
const std::string & getClientDataFile(bool testData = false) const;
|
||||
float getScale(bool testData = false) const;
|
||||
float getScaleMin(bool testData = false) const;
|
||||
float getScaleMax(bool testData = false) const;
|
||||
GameObjectType getGameObjectType(bool testData = false) const;
|
||||
bool getSendToClient(bool testData = false) const;
|
||||
float getScaleThresholdBeforeExtentTest(bool testData = false) const;
|
||||
float getScaleThresholdBeforeExtentTestMin(bool testData = false) const;
|
||||
float getScaleThresholdBeforeExtentTestMax(bool testData = false) const;
|
||||
float getClearFloraRadius(bool testData = false) const;
|
||||
float getClearFloraRadiusMin(bool testData = false) const;
|
||||
float getClearFloraRadiusMax(bool testData = false) const;
|
||||
SurfaceType getSurfaceType(bool testData = false) const;
|
||||
float getNoBuildRadius(bool testData = false) const;
|
||||
float getNoBuildRadiusMin(bool testData = false) const;
|
||||
float getNoBuildRadiusMax(bool testData = false) const;
|
||||
bool getOnlyVisibleInTools(bool testData = false) const;
|
||||
float getLocationReservationRadius(bool testData = false) const;
|
||||
float getLocationReservationRadiusMin(bool testData = false) const;
|
||||
float getLocationReservationRadiusMax(bool testData = false) const;
|
||||
bool getForceNoCollision(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+23
-12
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedPlayerObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
@@ -24,20 +24,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedPlayerObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedPlayerObjectTemplate::SharedPlayerObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedPlayerObjectTemplate::SharedPlayerObjectTemplate
|
||||
|
||||
@@ -46,8 +46,8 @@ SharedPlayerObjectTemplate::SharedPlayerObjectTemplate(const std::string & filen
|
||||
*/
|
||||
SharedPlayerObjectTemplate::~SharedPlayerObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedPlayerObjectTemplate::~SharedPlayerObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -104,6 +104,15 @@ Tag SharedPlayerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedPlayerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedPlayerObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedPlayerObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -113,8 +122,8 @@ Tag SharedPlayerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedPlayerObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedPlayerObjectTemplate_tag)
|
||||
{
|
||||
@@ -124,7 +133,7 @@ void SharedPlayerObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -144,8 +153,10 @@ void SharedPlayerObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -163,4 +174,4 @@ void SharedPlayerObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedPlayerObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+23
-12
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedPlayerQuestObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
@@ -24,20 +24,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedPlayerQuestObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedPlayerQuestObjectTemplate::SharedPlayerQuestObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedPlayerQuestObjectTemplate::SharedPlayerQuestObjectTemplate
|
||||
|
||||
@@ -46,8 +46,8 @@ SharedPlayerQuestObjectTemplate::SharedPlayerQuestObjectTemplate(const std::stri
|
||||
*/
|
||||
SharedPlayerQuestObjectTemplate::~SharedPlayerQuestObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedPlayerQuestObjectTemplate::~SharedPlayerQuestObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -104,6 +104,15 @@ Tag SharedPlayerQuestObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedPlayerQuestObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedPlayerQuestObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedPlayerQuestObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -113,8 +122,8 @@ Tag SharedPlayerQuestObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedPlayerQuestObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedPlayerQuestObjectTemplate_tag)
|
||||
{
|
||||
@@ -124,7 +133,7 @@ void SharedPlayerQuestObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -144,8 +153,10 @@ void SharedPlayerQuestObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -163,4 +174,4 @@ void SharedPlayerQuestObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedPlayerQuestObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedResourceContainerObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedResourceContainerObjectTemplate::SharedResourceContainerObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedResourceContainerObjectTemplate::SharedResourceContainerObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedResourceContainerObjectTemplate::SharedResourceContainerObjectTemplate(con
|
||||
*/
|
||||
SharedResourceContainerObjectTemplate::~SharedResourceContainerObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedResourceContainerObjectTemplate::~SharedResourceContainerObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedResourceContainerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedResourceContainerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedResourceContainerObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedResourceContainerObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedResourceContainerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedResourceContainerObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedResourceContainerObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedResourceContainerObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedResourceContainerObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedResourceContainerObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedResourceContainerObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+96
-19
@@ -13,6 +13,7 @@
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "sharedGame/SharedShipObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedGame/AssetCustomizationManager.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
@@ -29,20 +30,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedShipObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedShipObjectTemplate::SharedShipObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedShipObjectTemplate::SharedShipObjectTemplate
|
||||
|
||||
@@ -51,8 +52,8 @@ SharedShipObjectTemplate::SharedShipObjectTemplate(const std::string & filename)
|
||||
*/
|
||||
SharedShipObjectTemplate::~SharedShipObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedShipObjectTemplate::~SharedShipObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -128,16 +129,16 @@ void SharedShipObjectTemplate::createCustomizationDataPropertyAsNeeded(Object &o
|
||||
// variables since we are a creature. The SharedTangibleObjectTemplate version of
|
||||
// this function sets it to true.
|
||||
bool const skipSharedOwnerVariables = false;
|
||||
const std::string & appearanceFilename = getAppearanceFilename();
|
||||
if (!appearanceFilename.empty())
|
||||
{
|
||||
const std::string & appearanceFilename = getAppearanceFilename();
|
||||
if(!appearanceFilename.empty())
|
||||
{
|
||||
AssetCustomizationManager::addCustomizationVariablesForAsset(TemporaryCrcString(appearanceFilename.c_str(), true), *customizationData, skipSharedOwnerVariables);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Perhaps it's a POB ship, check the portalLayoutFilename
|
||||
const std::string & portalLayoutFilename = getPortalLayoutFilename();
|
||||
AssetCustomizationManager::addCustomizationVariablesForAsset(TemporaryCrcString(portalLayoutFilename.c_str(), true), *customizationData, skipSharedOwnerVariables);
|
||||
AssetCustomizationManager::addCustomizationVariablesForAsset(TemporaryCrcString(portalLayoutFilename.c_str(), true), *customizationData, skipSharedOwnerVariables);
|
||||
}
|
||||
|
||||
//-- release local reference to the CustomizationData instance
|
||||
@@ -146,12 +147,22 @@ void SharedShipObjectTemplate::createCustomizationDataPropertyAsNeeded(Object &o
|
||||
}
|
||||
|
||||
//@BEGIN TFD
|
||||
const std::string & SharedShipObjectTemplate::getCockpitFilename() const
|
||||
const std::string & SharedShipObjectTemplate::getCockpitFilename(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCockpitFilename(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cockpitFilename.isLoaded())
|
||||
@@ -169,16 +180,31 @@ const std::string & SharedShipObjectTemplate::getCockpitFilename() const
|
||||
}
|
||||
|
||||
const std::string & value = m_cockpitFilename.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedShipObjectTemplate::getCockpitFilename
|
||||
|
||||
bool SharedShipObjectTemplate::getHasWings() const
|
||||
bool SharedShipObjectTemplate::getHasWings(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
bool testDataValue = false;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHasWings(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hasWings.isLoaded())
|
||||
@@ -196,16 +222,31 @@ bool SharedShipObjectTemplate::getHasWings() const
|
||||
}
|
||||
|
||||
bool value = m_hasWings.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedShipObjectTemplate::getHasWings
|
||||
|
||||
bool SharedShipObjectTemplate::getPlayerControlled() const
|
||||
bool SharedShipObjectTemplate::getPlayerControlled(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
bool testDataValue = false;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getPlayerControlled(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_playerControlled.isLoaded())
|
||||
@@ -223,16 +264,31 @@ bool SharedShipObjectTemplate::getPlayerControlled() const
|
||||
}
|
||||
|
||||
bool value = m_playerControlled.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedShipObjectTemplate::getPlayerControlled
|
||||
|
||||
const std::string & SharedShipObjectTemplate::getInteriorLayoutFileName() const
|
||||
const std::string & SharedShipObjectTemplate::getInteriorLayoutFileName(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getInteriorLayoutFileName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_interiorLayoutFileName.isLoaded())
|
||||
@@ -250,10 +306,29 @@ const std::string & SharedShipObjectTemplate::getInteriorLayoutFileName() const
|
||||
}
|
||||
|
||||
const std::string & value = m_interiorLayoutFileName.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedShipObjectTemplate::getInteriorLayoutFileName
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedShipObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getCockpitFilename(true));
|
||||
IGNORE_RETURN(getHasWings(true));
|
||||
IGNORE_RETURN(getPlayerControlled(true));
|
||||
IGNORE_RETURN(getInteriorLayoutFileName(true));
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedShipObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -262,8 +337,8 @@ const std::string & SharedShipObjectTemplate::getInteriorLayoutFileName() const
|
||||
*/
|
||||
void SharedShipObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedShipObjectTemplate_tag)
|
||||
{
|
||||
@@ -273,7 +348,7 @@ void SharedShipObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -293,8 +368,10 @@ void SharedShipObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 4))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,4))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -324,4 +401,4 @@ void SharedShipObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedShipObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+9
-4
@@ -45,11 +45,16 @@ public:
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
const std::string & getCockpitFilename() const;
|
||||
bool getHasWings() const;
|
||||
bool getPlayerControlled() const;
|
||||
const std::string & getInteriorLayoutFileName() const;
|
||||
const std::string & getCockpitFilename(bool testData = false) const;
|
||||
bool getHasWings(bool testData = false) const;
|
||||
bool getPlayerControlled(bool testData = false) const;
|
||||
const std::string & getInteriorLayoutFileName(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedStaticObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedStaticObjectTemplate::SharedStaticObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedStaticObjectTemplate::SharedStaticObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedStaticObjectTemplate::SharedStaticObjectTemplate(const std::string & filen
|
||||
*/
|
||||
SharedStaticObjectTemplate::~SharedStaticObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedStaticObjectTemplate::~SharedStaticObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedStaticObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedStaticObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedStaticObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedObjectTemplate::testValues();
|
||||
} // SharedStaticObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedStaticObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedStaticObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedStaticObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedStaticObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedStaticObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedStaticObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedStaticObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+625
-122
File diff suppressed because it is too large
Load Diff
+48
-23
@@ -97,17 +97,22 @@ protected:
|
||||
virtual Tag getId(void) const;
|
||||
|
||||
public:
|
||||
const std::string & getVariableName(bool versionOk) const;
|
||||
int getMinValueInclusive(bool versionOk) const;
|
||||
int getMinValueInclusiveMin(bool versionOk) const;
|
||||
int getMinValueInclusiveMax(bool versionOk) const;
|
||||
int getDefaultValue(bool versionOk) const;
|
||||
int getDefaultValueMin(bool versionOk) const;
|
||||
int getDefaultValueMax(bool versionOk) const;
|
||||
int getMaxValueExclusive(bool versionOk) const;
|
||||
int getMaxValueExclusiveMin(bool versionOk) const;
|
||||
int getMaxValueExclusiveMax(bool versionOk) const;
|
||||
const std::string & getVariableName(bool versionOk, bool testData = false) const;
|
||||
int getMinValueInclusive(bool versionOk, bool testData = false) const;
|
||||
int getMinValueInclusiveMin(bool versionOk, bool testData = false) const;
|
||||
int getMinValueInclusiveMax(bool versionOk, bool testData = false) const;
|
||||
int getDefaultValue(bool versionOk, bool testData = false) const;
|
||||
int getDefaultValueMin(bool versionOk, bool testData = false) const;
|
||||
int getDefaultValueMax(bool versionOk, bool testData = false) const;
|
||||
int getMaxValueExclusive(bool versionOk, bool testData = false) const;
|
||||
int getMaxValueExclusiveMin(bool versionOk, bool testData = false) const;
|
||||
int getMaxValueExclusiveMax(bool versionOk, bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
@@ -142,12 +147,17 @@ private:
|
||||
virtual Tag getId(void) const;
|
||||
|
||||
public:
|
||||
const std::string & getVariableName(bool versionOk) const;
|
||||
const std::string & getPalettePathName(bool versionOk) const;
|
||||
int getDefaultPaletteIndex(bool versionOk) const;
|
||||
int getDefaultPaletteIndexMin(bool versionOk) const;
|
||||
int getDefaultPaletteIndexMax(bool versionOk) const;
|
||||
const std::string & getVariableName(bool versionOk, bool testData = false) const;
|
||||
const std::string & getPalettePathName(bool versionOk, bool testData = false) const;
|
||||
int getDefaultPaletteIndex(bool versionOk, bool testData = false) const;
|
||||
int getDefaultPaletteIndexMin(bool versionOk, bool testData = false) const;
|
||||
int getDefaultPaletteIndexMax(bool versionOk, bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
@@ -181,9 +191,14 @@ private:
|
||||
virtual Tag getId(void) const;
|
||||
|
||||
public:
|
||||
const std::string & getVariableName(bool versionOk) const;
|
||||
const std::string & getConstValue(bool versionOk) const;
|
||||
const std::string & getVariableName(bool versionOk, bool testData = false) const;
|
||||
const std::string & getConstValue(bool versionOk, bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
@@ -216,9 +231,14 @@ private:
|
||||
virtual Tag getId(void) const;
|
||||
|
||||
public:
|
||||
const std::string & getSourceVariable(bool versionOk) const;
|
||||
const std::string & getDependentVariable(bool versionOk) const;
|
||||
const std::string & getSourceVariable(bool versionOk, bool testData = false) const;
|
||||
const std::string & getDependentVariable(bool versionOk, bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
@@ -250,17 +270,22 @@ public:
|
||||
size_t getConstStringCustomizationVariablesCount(void) const;
|
||||
GameObjectType getSocketDestinations(int index) const;
|
||||
size_t getSocketDestinationsCount(void) const;
|
||||
const std::string & getStructureFootprintFileName() const;
|
||||
bool getUseStructureFootprintOutline() const;
|
||||
bool getTargetable() const;
|
||||
const std::string & getStructureFootprintFileName(bool testData = false) const;
|
||||
bool getUseStructureFootprintOutline(bool testData = false) const;
|
||||
bool getTargetable(bool testData = false) const;
|
||||
const std::string & getCertificationsRequired(int index) const;
|
||||
size_t getCertificationsRequiredCount(void) const;
|
||||
void getCustomizationVariableMapping(CustomizationVariableMapping &data, int index) const;
|
||||
void getCustomizationVariableMappingMin(CustomizationVariableMapping &data, int index) const;
|
||||
void getCustomizationVariableMappingMax(CustomizationVariableMapping &data, int index) const;
|
||||
size_t getCustomizationVariableMappingCount(void) const;
|
||||
ClientVisabilityFlags getClientVisabilityFlag() const;
|
||||
ClientVisabilityFlags getClientVisabilityFlag(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+98
-16
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedTerrainSurfaceObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
#include "sharedObject/ObjectTemplateList.h"
|
||||
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedTerrainSurfaceObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedTerrainSurfaceObjectTemplate::SharedTerrainSurfaceObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedTerrainSurfaceObjectTemplate::SharedTerrainSurfaceObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedTerrainSurfaceObjectTemplate::SharedTerrainSurfaceObjectTemplate(const std
|
||||
*/
|
||||
SharedTerrainSurfaceObjectTemplate::~SharedTerrainSurfaceObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedTerrainSurfaceObjectTemplate::~SharedTerrainSurfaceObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,12 +103,22 @@ Tag SharedTerrainSurfaceObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedTerrainSurfaceObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
float SharedTerrainSurfaceObjectTemplate::getCover() const
|
||||
float SharedTerrainSurfaceObjectTemplate::getCover(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCover(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cover.isLoaded())
|
||||
@@ -148,16 +158,33 @@ float SharedTerrainSurfaceObjectTemplate::getCover() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter cover is returning same value as base template.", DataResource::getName()));
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedTerrainSurfaceObjectTemplate::getCover
|
||||
|
||||
float SharedTerrainSurfaceObjectTemplate::getCoverMin() const
|
||||
float SharedTerrainSurfaceObjectTemplate::getCoverMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCoverMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cover.isLoaded())
|
||||
@@ -197,16 +224,33 @@ float SharedTerrainSurfaceObjectTemplate::getCoverMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter cover is returning same value as base template.", DataResource::getName()));
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedTerrainSurfaceObjectTemplate::getCoverMin
|
||||
|
||||
float SharedTerrainSurfaceObjectTemplate::getCoverMax() const
|
||||
float SharedTerrainSurfaceObjectTemplate::getCoverMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCoverMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cover.isLoaded())
|
||||
@@ -246,16 +290,33 @@ float SharedTerrainSurfaceObjectTemplate::getCoverMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter cover is returning same value as base template.", DataResource::getName()));
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedTerrainSurfaceObjectTemplate::getCoverMax
|
||||
|
||||
const std::string & SharedTerrainSurfaceObjectTemplate::getSurfaceType() const
|
||||
const std::string & SharedTerrainSurfaceObjectTemplate::getSurfaceType(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getSurfaceType(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_surfaceType.isLoaded())
|
||||
@@ -273,10 +334,29 @@ const std::string & SharedTerrainSurfaceObjectTemplate::getSurfaceType() const
|
||||
}
|
||||
|
||||
const std::string & value = m_surfaceType.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter surfaceType is returning same value as base template.", DataResource::getName()));
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedTerrainSurfaceObjectTemplate::getSurfaceType
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedTerrainSurfaceObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getCoverMin(true));
|
||||
IGNORE_RETURN(getCoverMax(true));
|
||||
IGNORE_RETURN(getSurfaceType(true));
|
||||
} // SharedTerrainSurfaceObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -285,8 +365,8 @@ const std::string & SharedTerrainSurfaceObjectTemplate::getSurfaceType() const
|
||||
*/
|
||||
void SharedTerrainSurfaceObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedTerrainSurfaceObjectTemplate_tag)
|
||||
{
|
||||
@@ -295,7 +375,7 @@ void SharedTerrainSurfaceObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -315,8 +395,10 @@ void SharedTerrainSurfaceObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -340,4 +422,4 @@ void SharedTerrainSurfaceObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedTerrainSurfaceObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+9
-4
@@ -44,11 +44,16 @@ public:
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
float getCover() const;
|
||||
float getCoverMin() const;
|
||||
float getCoverMax() const;
|
||||
const std::string & getSurfaceType() const;
|
||||
float getCover(bool testData = false) const;
|
||||
float getCoverMin(bool testData = false) const;
|
||||
float getCoverMax(bool testData = false) const;
|
||||
const std::string & getSurfaceType(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+23
-12
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedUniverseObjectTemplate.h"
|
||||
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
@@ -24,20 +24,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedUniverseObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedUniverseObjectTemplate::SharedUniverseObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedUniverseObjectTemplate::SharedUniverseObjectTemplate
|
||||
|
||||
@@ -46,8 +46,8 @@ SharedUniverseObjectTemplate::SharedUniverseObjectTemplate(const std::string & f
|
||||
*/
|
||||
SharedUniverseObjectTemplate::~SharedUniverseObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedUniverseObjectTemplate::~SharedUniverseObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -104,6 +104,15 @@ Tag SharedUniverseObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedUniverseObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedUniverseObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedObjectTemplate::testValues();
|
||||
} // SharedUniverseObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -113,8 +122,8 @@ Tag SharedUniverseObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedUniverseObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedUniverseObjectTemplate_tag)
|
||||
{
|
||||
@@ -124,7 +133,7 @@ void SharedUniverseObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -144,8 +153,10 @@ void SharedUniverseObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -163,4 +174,4 @@ void SharedUniverseObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedUniverseObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+323
-29
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedVehicleObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedVehicleObjectTemplate::SharedVehicleObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedVehicleObjectTemplate::SharedVehicleObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedVehicleObjectTemplate::SharedVehicleObjectTemplate(const std::string & fil
|
||||
*/
|
||||
SharedVehicleObjectTemplate::~SharedVehicleObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedVehicleObjectTemplate::~SharedVehicleObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -250,12 +250,22 @@ float SharedVehicleObjectTemplate::getSpeedMax(MovementTypes index) const
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getSpeedMax
|
||||
|
||||
float SharedVehicleObjectTemplate::getSlopeAversion() const
|
||||
float SharedVehicleObjectTemplate::getSlopeAversion(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getSlopeAversion(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_slopeAversion.isLoaded())
|
||||
@@ -295,16 +305,31 @@ float SharedVehicleObjectTemplate::getSlopeAversion() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getSlopeAversion
|
||||
|
||||
float SharedVehicleObjectTemplate::getSlopeAversionMin() const
|
||||
float SharedVehicleObjectTemplate::getSlopeAversionMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getSlopeAversionMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_slopeAversion.isLoaded())
|
||||
@@ -344,16 +369,31 @@ float SharedVehicleObjectTemplate::getSlopeAversionMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getSlopeAversionMin
|
||||
|
||||
float SharedVehicleObjectTemplate::getSlopeAversionMax() const
|
||||
float SharedVehicleObjectTemplate::getSlopeAversionMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getSlopeAversionMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_slopeAversion.isLoaded())
|
||||
@@ -393,16 +433,31 @@ float SharedVehicleObjectTemplate::getSlopeAversionMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getSlopeAversionMax
|
||||
|
||||
float SharedVehicleObjectTemplate::getHoverValue() const
|
||||
float SharedVehicleObjectTemplate::getHoverValue(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHoverValue(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hoverValue.isLoaded())
|
||||
@@ -442,16 +497,31 @@ float SharedVehicleObjectTemplate::getHoverValue() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getHoverValue
|
||||
|
||||
float SharedVehicleObjectTemplate::getHoverValueMin() const
|
||||
float SharedVehicleObjectTemplate::getHoverValueMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHoverValueMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hoverValue.isLoaded())
|
||||
@@ -491,16 +561,31 @@ float SharedVehicleObjectTemplate::getHoverValueMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getHoverValueMin
|
||||
|
||||
float SharedVehicleObjectTemplate::getHoverValueMax() const
|
||||
float SharedVehicleObjectTemplate::getHoverValueMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHoverValueMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hoverValue.isLoaded())
|
||||
@@ -540,16 +625,31 @@ float SharedVehicleObjectTemplate::getHoverValueMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getHoverValueMax
|
||||
|
||||
float SharedVehicleObjectTemplate::getTurnRate() const
|
||||
float SharedVehicleObjectTemplate::getTurnRate(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getTurnRate(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_turnRate.isLoaded())
|
||||
@@ -589,16 +689,31 @@ float SharedVehicleObjectTemplate::getTurnRate() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getTurnRate
|
||||
|
||||
float SharedVehicleObjectTemplate::getTurnRateMin() const
|
||||
float SharedVehicleObjectTemplate::getTurnRateMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getTurnRateMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_turnRate.isLoaded())
|
||||
@@ -638,16 +753,31 @@ float SharedVehicleObjectTemplate::getTurnRateMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getTurnRateMin
|
||||
|
||||
float SharedVehicleObjectTemplate::getTurnRateMax() const
|
||||
float SharedVehicleObjectTemplate::getTurnRateMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getTurnRateMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_turnRate.isLoaded())
|
||||
@@ -687,16 +817,31 @@ float SharedVehicleObjectTemplate::getTurnRateMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getTurnRateMax
|
||||
|
||||
float SharedVehicleObjectTemplate::getMaxVelocity() const
|
||||
float SharedVehicleObjectTemplate::getMaxVelocity(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getMaxVelocity(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_maxVelocity.isLoaded())
|
||||
@@ -736,16 +881,31 @@ float SharedVehicleObjectTemplate::getMaxVelocity() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getMaxVelocity
|
||||
|
||||
float SharedVehicleObjectTemplate::getMaxVelocityMin() const
|
||||
float SharedVehicleObjectTemplate::getMaxVelocityMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getMaxVelocityMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_maxVelocity.isLoaded())
|
||||
@@ -785,16 +945,31 @@ float SharedVehicleObjectTemplate::getMaxVelocityMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getMaxVelocityMin
|
||||
|
||||
float SharedVehicleObjectTemplate::getMaxVelocityMax() const
|
||||
float SharedVehicleObjectTemplate::getMaxVelocityMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getMaxVelocityMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_maxVelocity.isLoaded())
|
||||
@@ -834,16 +1009,31 @@ float SharedVehicleObjectTemplate::getMaxVelocityMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getMaxVelocityMax
|
||||
|
||||
float SharedVehicleObjectTemplate::getAcceleration() const
|
||||
float SharedVehicleObjectTemplate::getAcceleration(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getAcceleration(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_acceleration.isLoaded())
|
||||
@@ -883,16 +1073,31 @@ float SharedVehicleObjectTemplate::getAcceleration() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getAcceleration
|
||||
|
||||
float SharedVehicleObjectTemplate::getAccelerationMin() const
|
||||
float SharedVehicleObjectTemplate::getAccelerationMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getAccelerationMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_acceleration.isLoaded())
|
||||
@@ -932,16 +1137,31 @@ float SharedVehicleObjectTemplate::getAccelerationMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getAccelerationMin
|
||||
|
||||
float SharedVehicleObjectTemplate::getAccelerationMax() const
|
||||
float SharedVehicleObjectTemplate::getAccelerationMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getAccelerationMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_acceleration.isLoaded())
|
||||
@@ -981,16 +1201,31 @@ float SharedVehicleObjectTemplate::getAccelerationMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getAccelerationMax
|
||||
|
||||
float SharedVehicleObjectTemplate::getBraking() const
|
||||
float SharedVehicleObjectTemplate::getBraking(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getBraking(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_braking.isLoaded())
|
||||
@@ -1030,16 +1265,31 @@ float SharedVehicleObjectTemplate::getBraking() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getBraking
|
||||
|
||||
float SharedVehicleObjectTemplate::getBrakingMin() const
|
||||
float SharedVehicleObjectTemplate::getBrakingMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getBrakingMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_braking.isLoaded())
|
||||
@@ -1079,16 +1329,31 @@ float SharedVehicleObjectTemplate::getBrakingMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getBrakingMin
|
||||
|
||||
float SharedVehicleObjectTemplate::getBrakingMax() const
|
||||
float SharedVehicleObjectTemplate::getBrakingMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
float testDataValue = 0.0f;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedVehicleObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedVehicleObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getBrakingMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_braking.isLoaded())
|
||||
@@ -1128,10 +1393,37 @@ float SharedVehicleObjectTemplate::getBrakingMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedVehicleObjectTemplate::getBrakingMax
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedVehicleObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getSlopeAversionMin(true));
|
||||
IGNORE_RETURN(getSlopeAversionMax(true));
|
||||
IGNORE_RETURN(getHoverValueMin(true));
|
||||
IGNORE_RETURN(getHoverValueMax(true));
|
||||
IGNORE_RETURN(getTurnRateMin(true));
|
||||
IGNORE_RETURN(getTurnRateMax(true));
|
||||
IGNORE_RETURN(getMaxVelocityMin(true));
|
||||
IGNORE_RETURN(getMaxVelocityMax(true));
|
||||
IGNORE_RETURN(getAccelerationMin(true));
|
||||
IGNORE_RETURN(getAccelerationMax(true));
|
||||
IGNORE_RETURN(getBrakingMin(true));
|
||||
IGNORE_RETURN(getBrakingMax(true));
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedVehicleObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -1140,8 +1432,8 @@ float SharedVehicleObjectTemplate::getBrakingMax() const
|
||||
*/
|
||||
void SharedVehicleObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedVehicleObjectTemplate_tag)
|
||||
{
|
||||
@@ -1151,7 +1443,7 @@ void SharedVehicleObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -1171,8 +1463,10 @@ void SharedVehicleObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -1220,4 +1514,4 @@ void SharedVehicleObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedVehicleObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+23
-18
@@ -58,25 +58,30 @@ public:
|
||||
float getSpeed(MovementTypes index) const;
|
||||
float getSpeedMin(MovementTypes index) const;
|
||||
float getSpeedMax(MovementTypes index) const;
|
||||
float getSlopeAversion() const;
|
||||
float getSlopeAversionMin() const;
|
||||
float getSlopeAversionMax() const;
|
||||
float getHoverValue() const;
|
||||
float getHoverValueMin() const;
|
||||
float getHoverValueMax() const;
|
||||
float getTurnRate() const;
|
||||
float getTurnRateMin() const;
|
||||
float getTurnRateMax() const;
|
||||
float getMaxVelocity() const;
|
||||
float getMaxVelocityMin() const;
|
||||
float getMaxVelocityMax() const;
|
||||
float getAcceleration() const;
|
||||
float getAccelerationMin() const;
|
||||
float getAccelerationMax() const;
|
||||
float getBraking() const;
|
||||
float getBrakingMin() const;
|
||||
float getBrakingMax() const;
|
||||
float getSlopeAversion(bool testData = false) const;
|
||||
float getSlopeAversionMin(bool testData = false) const;
|
||||
float getSlopeAversionMax(bool testData = false) const;
|
||||
float getHoverValue(bool testData = false) const;
|
||||
float getHoverValueMin(bool testData = false) const;
|
||||
float getHoverValueMax(bool testData = false) const;
|
||||
float getTurnRate(bool testData = false) const;
|
||||
float getTurnRateMin(bool testData = false) const;
|
||||
float getTurnRateMax(bool testData = false) const;
|
||||
float getMaxVelocity(bool testData = false) const;
|
||||
float getMaxVelocityMin(bool testData = false) const;
|
||||
float getMaxVelocityMax(bool testData = false) const;
|
||||
float getAcceleration(bool testData = false) const;
|
||||
float getAccelerationMin(bool testData = false) const;
|
||||
float getAccelerationMax(bool testData = false) const;
|
||||
float getBraking(bool testData = false) const;
|
||||
float getBrakingMin(bool testData = false) const;
|
||||
float getBrakingMax(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+22
-11
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedWaypointObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedWaypointObjectTemplate::SharedWaypointObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedWaypointObjectTemplate::SharedWaypointObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedWaypointObjectTemplate::SharedWaypointObjectTemplate(const std::string & f
|
||||
*/
|
||||
SharedWaypointObjectTemplate::~SharedWaypointObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedWaypointObjectTemplate::~SharedWaypointObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ Tag SharedWaypointObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedWaypointObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedWaypointObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedWaypointObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
@@ -112,8 +121,8 @@ Tag SharedWaypointObjectTemplate::getHighestTemplateVersion(void) const
|
||||
*/
|
||||
void SharedWaypointObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedWaypointObjectTemplate_tag)
|
||||
{
|
||||
@@ -123,7 +132,7 @@ void SharedWaypointObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -143,8 +152,10 @@ void SharedWaypointObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -162,4 +173,4 @@ void SharedWaypointObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedWaypointObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ public:
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
+107
-16
@@ -23,20 +23,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedWeaponObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedWeaponObjectTemplate::SharedWeaponObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedTangibleObjectTemplate(filename)
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedWeaponObjectTemplate::SharedWeaponObjectTemplate
|
||||
|
||||
@@ -45,8 +45,8 @@ SharedWeaponObjectTemplate::SharedWeaponObjectTemplate(const std::string & filen
|
||||
*/
|
||||
SharedWeaponObjectTemplate::~SharedWeaponObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedWeaponObjectTemplate::~SharedWeaponObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -103,12 +103,22 @@ Tag SharedWeaponObjectTemplate::getHighestTemplateVersion(void) const
|
||||
} // SharedWeaponObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
const std::string & SharedWeaponObjectTemplate::getWeaponEffect() const
|
||||
const std::string & SharedWeaponObjectTemplate::getWeaponEffect(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::string testDataValue = DefaultString;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffect(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffect.isLoaded())
|
||||
@@ -126,16 +136,31 @@ const std::string & SharedWeaponObjectTemplate::getWeaponEffect() const
|
||||
}
|
||||
|
||||
const std::string & value = m_weaponEffect.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedWeaponObjectTemplate::getWeaponEffect
|
||||
|
||||
int SharedWeaponObjectTemplate::getWeaponEffectIndex() const
|
||||
int SharedWeaponObjectTemplate::getWeaponEffectIndex(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffectIndex(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffectIndex.isLoaded())
|
||||
@@ -175,16 +200,31 @@ int SharedWeaponObjectTemplate::getWeaponEffectIndex() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedWeaponObjectTemplate::getWeaponEffectIndex
|
||||
|
||||
int SharedWeaponObjectTemplate::getWeaponEffectIndexMin() const
|
||||
int SharedWeaponObjectTemplate::getWeaponEffectIndexMin(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffectIndexMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffectIndex.isLoaded())
|
||||
@@ -224,16 +264,31 @@ int SharedWeaponObjectTemplate::getWeaponEffectIndexMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedWeaponObjectTemplate::getWeaponEffectIndexMin
|
||||
|
||||
int SharedWeaponObjectTemplate::getWeaponEffectIndexMax() const
|
||||
int SharedWeaponObjectTemplate::getWeaponEffectIndexMax(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int testDataValue = 0;
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffectIndexMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffectIndex.isLoaded())
|
||||
@@ -273,16 +328,31 @@ int SharedWeaponObjectTemplate::getWeaponEffectIndexMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedWeaponObjectTemplate::getWeaponEffectIndexMax
|
||||
|
||||
SharedWeaponObjectTemplate::AttackType SharedWeaponObjectTemplate::getAttackType() const
|
||||
SharedWeaponObjectTemplate::AttackType SharedWeaponObjectTemplate::getAttackType(bool testData) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
SharedWeaponObjectTemplate::AttackType testDataValue = static_cast<SharedWeaponObjectTemplate::AttackType>(0);
|
||||
#else
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getAttackType(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_attackType.isLoaded())
|
||||
@@ -300,10 +370,29 @@ SharedWeaponObjectTemplate::AttackType SharedWeaponObjectTemplate::getAttackType
|
||||
}
|
||||
|
||||
AttackType value = static_cast<AttackType>(m_attackType.getValue());
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
return value;
|
||||
} // SharedWeaponObjectTemplate::getAttackType
|
||||
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedWeaponObjectTemplate::testValues(void) const
|
||||
{
|
||||
IGNORE_RETURN(getWeaponEffect(true));
|
||||
IGNORE_RETURN(getWeaponEffectIndexMin(true));
|
||||
IGNORE_RETURN(getWeaponEffectIndexMax(true));
|
||||
IGNORE_RETURN(getAttackType(true));
|
||||
SharedTangibleObjectTemplate::testValues();
|
||||
} // SharedWeaponObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
@@ -312,8 +401,8 @@ SharedWeaponObjectTemplate::AttackType SharedWeaponObjectTemplate::getAttackType
|
||||
*/
|
||||
void SharedWeaponObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedWeaponObjectTemplate_tag)
|
||||
{
|
||||
@@ -323,7 +412,7 @@ void SharedWeaponObjectTemplate::load(Iff &file)
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -343,8 +432,10 @@ void SharedWeaponObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 4))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,4))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -372,4 +463,4 @@ void SharedWeaponObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedWeaponObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
+10
-5
@@ -54,12 +54,17 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
const std::string & getWeaponEffect() const;
|
||||
int getWeaponEffectIndex() const;
|
||||
int getWeaponEffectIndexMin() const;
|
||||
int getWeaponEffectIndexMax() const;
|
||||
AttackType getAttackType() const;
|
||||
const std::string & getWeaponEffect(bool testData = false) const;
|
||||
int getWeaponEffectIndex(bool testData = false) const;
|
||||
int getWeaponEffectIndexMin(bool testData = false) const;
|
||||
int getWeaponEffectIndexMax(bool testData = false) const;
|
||||
AttackType getAttackType(bool testData = false) const;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
Reference in New Issue
Block a user