mirror of
https://bitbucket.org/seefoe/src.git
synced 2026-07-31 01:15:45 -04:00
Merge branch 'testing' of git.stellabellum.net:staff/src into testing
This commit is contained in:
@@ -197,18 +197,18 @@ set(SHARED_SOURCES
|
||||
shared/objectTemplate/SharedJediManagerObjectTemplate.h
|
||||
shared/objectTemplate/SharedManufactureSchematicObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedManufactureSchematicObjectTemplate.h
|
||||
shared/objectTemplate/SharedMissionDataObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedMissionDataObjectTemplate.h
|
||||
shared/objectTemplate/SharedMissionListEntryObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedMissionListEntryObjectTemplate.h
|
||||
shared/objectTemplate/SharedMissionObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedMissionObjectTemplate.h
|
||||
shared/objectTemplate/SharedObjectTemplateClientData.cpp
|
||||
shared/objectTemplate/SharedObjectTemplateClientData.h
|
||||
shared/objectTemplate/SharedObjectTemplateInterface.cpp
|
||||
shared/objectTemplate/SharedObjectTemplateInterface.h
|
||||
shared/objectTemplate/SharedObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedObjectTemplate.h
|
||||
shared/objectTemplate/SharedPlayerQuestObjectTemplate.h
|
||||
shared/objectTemplate/SharedPlayerQuestObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedPlayerObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedPlayerObjectTemplate.h
|
||||
shared/objectTemplate/SharedPlayerQuestObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedPlayerQuestObjectTemplate.h
|
||||
shared/objectTemplate/SharedResourceContainerObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedResourceContainerObjectTemplate.h
|
||||
shared/objectTemplate/SharedShipObjectTemplate.cpp
|
||||
@@ -219,6 +219,8 @@ set(SHARED_SOURCES
|
||||
shared/objectTemplate/SharedTangibleObjectTemplate.h
|
||||
shared/objectTemplate/SharedTerrainSurfaceObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedTerrainSurfaceObjectTemplate.h
|
||||
shared/objectTemplate/SharedTokenObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedTokenObjectTemplate.h
|
||||
shared/objectTemplate/SharedUniverseObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedUniverseObjectTemplate.h
|
||||
shared/objectTemplate/SharedVehicleObjectTemplate.cpp
|
||||
@@ -226,7 +228,7 @@ set(SHARED_SOURCES
|
||||
shared/objectTemplate/SharedWaypointObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedWaypointObjectTemplate.h
|
||||
shared/objectTemplate/SharedWeaponObjectTemplate.cpp
|
||||
shared/objectTemplate/SharedWeaponObjectTemplate.h
|
||||
shared/objectTemplate/SharedWeaponObjectTemplate.h
|
||||
|
||||
shared/quest/PlayerQuestData.cpp
|
||||
shared/quest/PlayerQuestData.h
|
||||
|
||||
engine/shared/library/sharedGame/src/shared/objectTemplate/SharedBattlefieldMarkerObjectTemplate.cpp
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+743
-71
File diff suppressed because it is too large
Load Diff
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
Executable → Regular
+23
-9
@@ -61,7 +61,6 @@ public:
|
||||
|
||||
enum DamageType
|
||||
{
|
||||
DT_none = 0x00000000,
|
||||
DT_kinetic = 0x00000001,
|
||||
DT_energy = 0x00000002,
|
||||
DT_blast = 0x00000004,
|
||||
@@ -109,9 +108,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 +148,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 +185,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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
//========================================================================
|
||||
//
|
||||
// SharedMissionDataObjectTemplate.cpp
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedMissionDataObjectTemplate.h"
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
#include "sharedObject/ObjectTemplateList.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
//@BEGIN TFD TEMPLATE REFS
|
||||
//@END TFD TEMPLATE REFS
|
||||
#include <stdio.h>
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedMissionDataObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedMissionDataObjectTemplate::SharedMissionDataObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedMissionDataObjectTemplate::SharedMissionDataObjectTemplate
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
SharedMissionDataObjectTemplate::~SharedMissionDataObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedMissionDataObjectTemplate::~SharedMissionDataObjectTemplate
|
||||
|
||||
/**
|
||||
* Static function used to register this template.
|
||||
*/
|
||||
void SharedMissionDataObjectTemplate::registerMe(void)
|
||||
{
|
||||
ObjectTemplateList::registerTemplate(SharedMissionDataObjectTemplate_tag, create);
|
||||
} // SharedMissionDataObjectTemplate::registerMe
|
||||
|
||||
/**
|
||||
* Creates a SharedMissionDataObjectTemplate template.
|
||||
*
|
||||
* @return a new instance of the template
|
||||
*/
|
||||
ObjectTemplate * SharedMissionDataObjectTemplate::create(const std::string & filename)
|
||||
{
|
||||
return new SharedMissionDataObjectTemplate(filename);
|
||||
} // SharedMissionDataObjectTemplate::create
|
||||
|
||||
/**
|
||||
* Returns the template id.
|
||||
*
|
||||
* @return the template id
|
||||
*/
|
||||
Tag SharedMissionDataObjectTemplate::getId(void) const
|
||||
{
|
||||
return SharedMissionDataObjectTemplate_tag;
|
||||
} // SharedMissionDataObjectTemplate::getId
|
||||
|
||||
/**
|
||||
* Returns this template's version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
Tag SharedMissionDataObjectTemplate::getTemplateVersion(void) const
|
||||
{
|
||||
return m_templateVersion;
|
||||
} // SharedMissionDataObjectTemplate::getTemplateVersion
|
||||
|
||||
/**
|
||||
* Returns the highest version of this template or it's base templates.
|
||||
*
|
||||
* @return the highest version
|
||||
*/
|
||||
Tag SharedMissionDataObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedMissionDataObjectTemplate * base = dynamic_cast<const SharedMissionDataObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedMissionDataObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedMissionDataObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedMissionDataObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
*
|
||||
* @param file file to load from
|
||||
*/
|
||||
void SharedMissionDataObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedMissionDataObjectTemplate_tag)
|
||||
{
|
||||
SharedIntangibleObjectTemplate::load(file);
|
||||
return;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
std::string baseFilename;
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
|
||||
file.enterChunk();
|
||||
int paramCount = file.read_int32();
|
||||
file.exitChunk();
|
||||
UNREF(paramName);
|
||||
UNREF(paramCount);
|
||||
|
||||
file.exitForm();
|
||||
SharedIntangibleObjectTemplate::load(file);
|
||||
file.exitForm();
|
||||
return;
|
||||
} // SharedMissionDataObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
//========================================================================
|
||||
//
|
||||
// SharedMissionDataObjectTemplate.h
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_SharedMissionDataObjectTemplate_H
|
||||
#define _INCLUDED_SharedMissionDataObjectTemplate_H
|
||||
|
||||
#include "SharedIntangibleObjectTemplate.h"
|
||||
#include "sharedFoundation/DynamicVariable.h"
|
||||
#include "sharedUtility/TemplateParameter.h"
|
||||
|
||||
|
||||
class Vector;
|
||||
typedef StructParam<ObjectTemplate> StructParamOT;
|
||||
//@BEGIN TFD TEMPLATE REFS
|
||||
//@END TFD TEMPLATE REFS
|
||||
|
||||
|
||||
class SharedMissionDataObjectTemplate : public SharedIntangibleObjectTemplate
|
||||
{
|
||||
public:
|
||||
//@BEGIN TFD ID
|
||||
enum
|
||||
{
|
||||
SharedMissionDataObjectTemplate_tag = TAG(S,M,S,D)
|
||||
};
|
||||
//@END TFD ID
|
||||
public:
|
||||
SharedMissionDataObjectTemplate(const std::string & filename);
|
||||
virtual ~SharedMissionDataObjectTemplate();
|
||||
|
||||
virtual Tag getId(void) const;
|
||||
virtual Tag getTemplateVersion(void) const;
|
||||
virtual Tag getHighestTemplateVersion(void) const;
|
||||
static void install(bool allowDefaultTemplateParams = true);
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
private:
|
||||
//@END TFD
|
||||
|
||||
private:
|
||||
Tag m_templateVersion; // the template version
|
||||
bool m_versionOk; // flag that the template version loaded is the one we expect
|
||||
static bool ms_allowDefaultTemplateParams; // flag to allow defaut params instead of fataling
|
||||
|
||||
static void registerMe(void);
|
||||
static ObjectTemplate * create(const std::string & filename);
|
||||
|
||||
// no copying
|
||||
SharedMissionDataObjectTemplate(const SharedMissionDataObjectTemplate &);
|
||||
SharedMissionDataObjectTemplate & operator =(const SharedMissionDataObjectTemplate &);
|
||||
};
|
||||
|
||||
|
||||
inline void SharedMissionDataObjectTemplate::install(bool allowDefaultTemplateParams)
|
||||
{
|
||||
ms_allowDefaultTemplateParams = allowDefaultTemplateParams;
|
||||
//@BEGIN TFD INSTALL
|
||||
SharedMissionDataObjectTemplate::registerMe();
|
||||
//@END TFD INSTALL
|
||||
}
|
||||
|
||||
|
||||
#endif // _INCLUDED_SharedMissionDataObjectTemplate_H
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
//========================================================================
|
||||
//
|
||||
// SharedMissionListEntryObjectTemplate.cpp
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedMissionListEntryObjectTemplate.h"
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
#include "sharedObject/ObjectTemplateList.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
//@BEGIN TFD TEMPLATE REFS
|
||||
//@END TFD TEMPLATE REFS
|
||||
#include <stdio.h>
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedMissionListEntryObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedMissionListEntryObjectTemplate::SharedMissionListEntryObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedMissionListEntryObjectTemplate::SharedMissionListEntryObjectTemplate
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
SharedMissionListEntryObjectTemplate::~SharedMissionListEntryObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedMissionListEntryObjectTemplate::~SharedMissionListEntryObjectTemplate
|
||||
|
||||
/**
|
||||
* Static function used to register this template.
|
||||
*/
|
||||
void SharedMissionListEntryObjectTemplate::registerMe(void)
|
||||
{
|
||||
ObjectTemplateList::registerTemplate(SharedMissionListEntryObjectTemplate_tag, create);
|
||||
} // SharedMissionListEntryObjectTemplate::registerMe
|
||||
|
||||
/**
|
||||
* Creates a SharedMissionListEntryObjectTemplate template.
|
||||
*
|
||||
* @return a new instance of the template
|
||||
*/
|
||||
ObjectTemplate * SharedMissionListEntryObjectTemplate::create(const std::string & filename)
|
||||
{
|
||||
return new SharedMissionListEntryObjectTemplate(filename);
|
||||
} // SharedMissionListEntryObjectTemplate::create
|
||||
|
||||
/**
|
||||
* Returns the template id.
|
||||
*
|
||||
* @return the template id
|
||||
*/
|
||||
Tag SharedMissionListEntryObjectTemplate::getId(void) const
|
||||
{
|
||||
return SharedMissionListEntryObjectTemplate_tag;
|
||||
} // SharedMissionListEntryObjectTemplate::getId
|
||||
|
||||
/**
|
||||
* Returns this template's version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
Tag SharedMissionListEntryObjectTemplate::getTemplateVersion(void) const
|
||||
{
|
||||
return m_templateVersion;
|
||||
} // SharedMissionListEntryObjectTemplate::getTemplateVersion
|
||||
|
||||
/**
|
||||
* Returns the highest version of this template or it's base templates.
|
||||
*
|
||||
* @return the highest version
|
||||
*/
|
||||
Tag SharedMissionListEntryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedMissionListEntryObjectTemplate * base = dynamic_cast<const SharedMissionListEntryObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedMissionListEntryObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedMissionListEntryObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedMissionListEntryObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
*
|
||||
* @param file file to load from
|
||||
*/
|
||||
void SharedMissionListEntryObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedMissionListEntryObjectTemplate_tag)
|
||||
{
|
||||
SharedIntangibleObjectTemplate::load(file);
|
||||
return;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
std::string baseFilename;
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
|
||||
file.enterChunk();
|
||||
int paramCount = file.read_int32();
|
||||
file.exitChunk();
|
||||
UNREF(paramName);
|
||||
UNREF(paramCount);
|
||||
|
||||
file.exitForm();
|
||||
SharedIntangibleObjectTemplate::load(file);
|
||||
file.exitForm();
|
||||
return;
|
||||
} // SharedMissionListEntryObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
//========================================================================
|
||||
//
|
||||
// SharedMissionListEntryObjectTemplate.h
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_SharedMissionListEntryObjectTemplate_H
|
||||
#define _INCLUDED_SharedMissionListEntryObjectTemplate_H
|
||||
|
||||
#include "SharedIntangibleObjectTemplate.h"
|
||||
#include "sharedFoundation/DynamicVariable.h"
|
||||
#include "sharedUtility/TemplateParameter.h"
|
||||
|
||||
|
||||
class Vector;
|
||||
typedef StructParam<ObjectTemplate> StructParamOT;
|
||||
//@BEGIN TFD TEMPLATE REFS
|
||||
//@END TFD TEMPLATE REFS
|
||||
|
||||
|
||||
class SharedMissionListEntryObjectTemplate : public SharedIntangibleObjectTemplate
|
||||
{
|
||||
public:
|
||||
//@BEGIN TFD ID
|
||||
enum
|
||||
{
|
||||
SharedMissionListEntryObjectTemplate_tag = TAG(S,M,L,E)
|
||||
};
|
||||
//@END TFD ID
|
||||
public:
|
||||
SharedMissionListEntryObjectTemplate(const std::string & filename);
|
||||
virtual ~SharedMissionListEntryObjectTemplate();
|
||||
|
||||
virtual Tag getId(void) const;
|
||||
virtual Tag getTemplateVersion(void) const;
|
||||
virtual Tag getHighestTemplateVersion(void) const;
|
||||
static void install(bool allowDefaultTemplateParams = true);
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
private:
|
||||
//@END TFD
|
||||
|
||||
private:
|
||||
Tag m_templateVersion; // the template version
|
||||
bool m_versionOk; // flag that the template version loaded is the one we expect
|
||||
static bool ms_allowDefaultTemplateParams; // flag to allow defaut params instead of fataling
|
||||
|
||||
static void registerMe(void);
|
||||
static ObjectTemplate * create(const std::string & filename);
|
||||
|
||||
// no copying
|
||||
SharedMissionListEntryObjectTemplate(const SharedMissionListEntryObjectTemplate &);
|
||||
SharedMissionListEntryObjectTemplate & operator =(const SharedMissionListEntryObjectTemplate &);
|
||||
};
|
||||
|
||||
|
||||
inline void SharedMissionListEntryObjectTemplate::install(bool allowDefaultTemplateParams)
|
||||
{
|
||||
ms_allowDefaultTemplateParams = allowDefaultTemplateParams;
|
||||
//@BEGIN TFD INSTALL
|
||||
SharedMissionListEntryObjectTemplate::registerMe();
|
||||
//@END TFD INSTALL
|
||||
}
|
||||
|
||||
|
||||
#endif // _INCLUDED_SharedMissionListEntryObjectTemplate_H
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+629
-79
File diff suppressed because it is too large
Load Diff
Executable → Regular
+39
-34
@@ -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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
engine/shared/library/sharedGame/src/shared/objectTemplate/SharedResourceContainerObjectTemplate.cpp
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+625
-122
File diff suppressed because it is too large
Load Diff
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+90
-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,31 @@ float SharedTerrainSurfaceObjectTemplate::getCover() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#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 +222,31 @@ float SharedTerrainSurfaceObjectTemplate::getCoverMin() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#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 +286,31 @@ float SharedTerrainSurfaceObjectTemplate::getCoverMax() const
|
||||
else if (delta == '_')
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#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 +328,27 @@ const std::string & SharedTerrainSurfaceObjectTemplate::getSurfaceType() const
|
||||
}
|
||||
|
||||
const std::string & value = m_surfaceType.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#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 +357,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 +367,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 +387,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 +414,4 @@ void SharedTerrainSurfaceObjectTemplate::load(Iff &file)
|
||||
return;
|
||||
} // SharedTerrainSurfaceObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
//========================================================================
|
||||
//
|
||||
// SharedTokenObjectTemplate.cpp
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "SharedTokenObjectTemplate.h"
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedObject/ObjectTemplate.h"
|
||||
#include "sharedObject/ObjectTemplateList.h"
|
||||
#include "sharedMath/Vector.h"
|
||||
//@BEGIN TFD TEMPLATE REFS
|
||||
//@END TFD TEMPLATE REFS
|
||||
#include <stdio.h>
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool SharedTokenObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
SharedTokenObjectTemplate::SharedTokenObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedTokenObjectTemplate::SharedTokenObjectTemplate
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
SharedTokenObjectTemplate::~SharedTokenObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedTokenObjectTemplate::~SharedTokenObjectTemplate
|
||||
|
||||
/**
|
||||
* Static function used to register this template.
|
||||
*/
|
||||
void SharedTokenObjectTemplate::registerMe(void)
|
||||
{
|
||||
ObjectTemplateList::registerTemplate(SharedTokenObjectTemplate_tag, create);
|
||||
} // SharedTokenObjectTemplate::registerMe
|
||||
|
||||
/**
|
||||
* Creates a SharedTokenObjectTemplate template.
|
||||
*
|
||||
* @return a new instance of the template
|
||||
*/
|
||||
ObjectTemplate * SharedTokenObjectTemplate::create(const std::string & filename)
|
||||
{
|
||||
return new SharedTokenObjectTemplate(filename);
|
||||
} // SharedTokenObjectTemplate::create
|
||||
|
||||
/**
|
||||
* Returns the template id.
|
||||
*
|
||||
* @return the template id
|
||||
*/
|
||||
Tag SharedTokenObjectTemplate::getId(void) const
|
||||
{
|
||||
return SharedTokenObjectTemplate_tag;
|
||||
} // SharedTokenObjectTemplate::getId
|
||||
|
||||
/**
|
||||
* Returns this template's version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
Tag SharedTokenObjectTemplate::getTemplateVersion(void) const
|
||||
{
|
||||
return m_templateVersion;
|
||||
} // SharedTokenObjectTemplate::getTemplateVersion
|
||||
|
||||
/**
|
||||
* Returns the highest version of this template or it's base templates.
|
||||
*
|
||||
* @return the highest version
|
||||
*/
|
||||
Tag SharedTokenObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedTokenObjectTemplate * base = dynamic_cast<const SharedTokenObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedTokenObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
#ifdef _DEBUG
|
||||
/**
|
||||
* Special function used by datalint. Checks for duplicate values in base and derived templates.
|
||||
*/
|
||||
void SharedTokenObjectTemplate::testValues(void) const
|
||||
{
|
||||
SharedIntangibleObjectTemplate::testValues();
|
||||
} // SharedTokenObjectTemplate::testValues
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
*
|
||||
* @param file file to load from
|
||||
*/
|
||||
void SharedTokenObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != SharedTokenObjectTemplate_tag)
|
||||
{
|
||||
SharedIntangibleObjectTemplate::load(file);
|
||||
return;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
std::string baseFilename;
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
|
||||
file.enterChunk();
|
||||
int paramCount = file.read_int32();
|
||||
file.exitChunk();
|
||||
UNREF(paramName);
|
||||
UNREF(paramCount);
|
||||
|
||||
file.exitForm();
|
||||
SharedIntangibleObjectTemplate::load(file);
|
||||
file.exitForm();
|
||||
return;
|
||||
} // SharedTokenObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
//========================================================================
|
||||
//
|
||||
// SharedTokenObjectTemplate.h
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_SharedTokenObjectTemplate_H
|
||||
#define _INCLUDED_SharedTokenObjectTemplate_H
|
||||
|
||||
#include "SharedIntangibleObjectTemplate.h"
|
||||
#include "sharedFoundation/DynamicVariable.h"
|
||||
#include "sharedUtility/TemplateParameter.h"
|
||||
|
||||
|
||||
class Vector;
|
||||
typedef StructParam<ObjectTemplate> StructParamOT;
|
||||
//@BEGIN TFD TEMPLATE REFS
|
||||
//@END TFD TEMPLATE REFS
|
||||
|
||||
|
||||
class SharedTokenObjectTemplate : public SharedIntangibleObjectTemplate
|
||||
{
|
||||
public:
|
||||
//@BEGIN TFD ID
|
||||
enum
|
||||
{
|
||||
SharedTokenObjectTemplate_tag = TAG(S,T,O,K)
|
||||
};
|
||||
//@END TFD ID
|
||||
public:
|
||||
SharedTokenObjectTemplate(const std::string & filename);
|
||||
virtual ~SharedTokenObjectTemplate();
|
||||
|
||||
virtual Tag getId(void) const;
|
||||
virtual Tag getTemplateVersion(void) const;
|
||||
virtual Tag getHighestTemplateVersion(void) const;
|
||||
static void install(bool allowDefaultTemplateParams = true);
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
// special code used by datalint
|
||||
virtual void testValues(void) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
|
||||
private:
|
||||
//@END TFD
|
||||
|
||||
private:
|
||||
Tag m_templateVersion; // the template version
|
||||
bool m_versionOk; // flag that the template version loaded is the one we expect
|
||||
static bool ms_allowDefaultTemplateParams; // flag to allow defaut params instead of fataling
|
||||
|
||||
static void registerMe(void);
|
||||
static ObjectTemplate * create(const std::string & filename);
|
||||
|
||||
// no copying
|
||||
SharedTokenObjectTemplate(const SharedTokenObjectTemplate &);
|
||||
SharedTokenObjectTemplate & operator =(const SharedTokenObjectTemplate &);
|
||||
};
|
||||
|
||||
|
||||
inline void SharedTokenObjectTemplate::install(bool allowDefaultTemplateParams)
|
||||
{
|
||||
ms_allowDefaultTemplateParams = allowDefaultTemplateParams;
|
||||
//@BEGIN TFD INSTALL
|
||||
SharedTokenObjectTemplate::registerMe();
|
||||
//@END TFD INSTALL
|
||||
}
|
||||
|
||||
|
||||
#endif // _INCLUDED_SharedTokenObjectTemplate_H
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
Executable → Regular
+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
|
||||
|
||||
Executable → Regular
+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);
|
||||
|
||||
@@ -38,16 +38,22 @@ set(SHARED_SOURCES
|
||||
shared/template/ServerManufactureInstallationObjectTemplate.h
|
||||
shared/template/ServerManufactureSchematicObjectTemplate.cpp
|
||||
shared/template/ServerManufactureSchematicObjectTemplate.h
|
||||
shared/template/ServerMissionBoardObjectTemplate.cpp
|
||||
shared/template/ServerMissionBoardObjectTemplate.h
|
||||
shared/template/ServerMissionDataObjectTemplate.cpp
|
||||
shared/template/ServerMissionDataObjectTemplate.h
|
||||
shared/template/ServerMissionListEntryObjectTemplate.cpp
|
||||
shared/template/ServerMissionListEntryObjectTemplate.h
|
||||
shared/template/ServerMissionObjectTemplate.cpp
|
||||
shared/template/ServerMissionObjectTemplate.h
|
||||
shared/template/ServerObjectTemplate.cpp
|
||||
shared/template/ServerObjectTemplate.h
|
||||
shared/template/ServerPlanetObjectTemplate.cpp
|
||||
shared/template/ServerPlanetObjectTemplate.h
|
||||
shared/template/ServerPlayerQuestObjectTemplate.cpp
|
||||
shared/template/ServerPlayerQuestObjectTemplate.h
|
||||
shared/template/ServerPlayerObjectTemplate.cpp
|
||||
shared/template/ServerPlayerObjectTemplate.h
|
||||
shared/template/ServerPlayerQuestObjectTemplate.cpp
|
||||
shared/template/ServerPlayerQuestObjectTemplate.h
|
||||
shared/template/ServerResourceClassObjectTemplate.cpp
|
||||
shared/template/ServerResourceClassObjectTemplate.h
|
||||
shared/template/ServerResourceContainerObjectTemplate.cpp
|
||||
@@ -102,6 +108,10 @@ set(SHARED_SOURCES
|
||||
shared/template/SharedJediManagerObjectTemplate.h
|
||||
shared/template/SharedManufactureSchematicObjectTemplate.cpp
|
||||
shared/template/SharedManufactureSchematicObjectTemplate.h
|
||||
shared/template/SharedMissionDataObjectTemplate.cpp
|
||||
shared/template/SharedMissionDataObjectTemplate.h
|
||||
shared/template/SharedMissionListEntryObjectTemplate.cpp
|
||||
shared/template/SharedMissionListEntryObjectTemplate.h
|
||||
shared/template/SharedMissionObjectTemplate.cpp
|
||||
shared/template/SharedMissionObjectTemplate.h
|
||||
shared/template/SharedObjectTemplate.cpp
|
||||
@@ -129,7 +139,7 @@ set(SHARED_SOURCES
|
||||
shared/template/SharedWaypointObjectTemplate.cpp
|
||||
shared/template/SharedWaypointObjectTemplate.h
|
||||
shared/template/SharedWeaponObjectTemplate.cpp
|
||||
shared/template/SharedWeaponObjectTemplate.h
|
||||
shared/template/SharedWeaponObjectTemplate.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
Executable → Regular
+25
-24
@@ -17,9 +17,9 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
@@ -27,11 +27,9 @@
|
||||
ServerArmorTemplate::ServerArmorTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: TpfTemplate(filename)
|
||||
, m_specialProtectionLoaded(false)
|
||||
, m_specialProtectionAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_specialProtectionLoaded(false)
|
||||
,m_specialProtectionAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerArmorTemplate::ServerArmorTemplate
|
||||
|
||||
@@ -40,7 +38,7 @@ ServerArmorTemplate::ServerArmorTemplate(const std::string & filename)
|
||||
*/
|
||||
ServerArmorTemplate::~ServerArmorTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<StructParamOT *>::iterator iter;
|
||||
for (iter = m_specialProtection.begin(); iter != m_specialProtection.end(); ++iter)
|
||||
@@ -50,7 +48,7 @@ ServerArmorTemplate::~ServerArmorTemplate()
|
||||
}
|
||||
m_specialProtection.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerArmorTemplate::~ServerArmorTemplate
|
||||
|
||||
/**
|
||||
@@ -98,10 +96,10 @@ Tag ServerArmorTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerArmorTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerArmorTemplate * base = dynamic_cast<const ServerArmorTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerArmorTemplate::getHighestTemplateVersion
|
||||
@@ -275,6 +273,7 @@ bool ServerArmorTemplate::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerArmorTemplate::isAppend
|
||||
|
||||
|
||||
int ServerArmorTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "specialProtection") == 0)
|
||||
@@ -297,8 +296,8 @@ int ServerArmorTemplate::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerArmorTemplate::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() != ServerArmorTemplate_tag)
|
||||
{
|
||||
@@ -308,7 +307,7 @@ void ServerArmorTemplate::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();
|
||||
@@ -328,7 +327,7 @@ void ServerArmorTemplate::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()));
|
||||
@@ -401,18 +400,18 @@ void ServerArmorTemplate::load(Iff &file)
|
||||
*/
|
||||
void ServerArmorTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerArmorTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D, E, R, V));
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0, 0, 0, 1));
|
||||
file.insertForm(TAG(0,0,0,1));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -447,7 +446,7 @@ void ServerArmorTemplate::save(Iff &file)
|
||||
count = m_specialProtection.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_specialProtection[i]->saveToIff(file); }
|
||||
m_specialProtection[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save vulnerability
|
||||
@@ -462,7 +461,7 @@ void ServerArmorTemplate::save(Iff &file)
|
||||
count = 3;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 3; ++i)
|
||||
m_encumbrance[i].saveToIff(file); }
|
||||
m_encumbrance[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
|
||||
@@ -477,6 +476,7 @@ void ServerArmorTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // ServerArmorTemplate::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerArmorTemplate::_SpecialProtection
|
||||
|
||||
@@ -620,6 +620,7 @@ bool ServerArmorTemplate::_SpecialProtection::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerArmorTemplate::_SpecialProtection::isAppend
|
||||
|
||||
|
||||
int ServerArmorTemplate::_SpecialProtection::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -633,8 +634,8 @@ int ServerArmorTemplate::_SpecialProtection::getListLength(const char *name) con
|
||||
*/
|
||||
void ServerArmorTemplate::_SpecialProtection::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();
|
||||
|
||||
@@ -664,7 +665,7 @@ void ServerArmorTemplate::_SpecialProtection::load(Iff &file)
|
||||
*/
|
||||
void ServerArmorTemplate::_SpecialProtection::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_SpecialProtection_tag);
|
||||
|
||||
@@ -693,4 +694,4 @@ void ServerArmorTemplate::_SpecialProtection::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // ServerArmorTemplate::_SpecialProtection::save
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
-1
@@ -54,7 +54,6 @@ public:
|
||||
|
||||
enum DamageType
|
||||
{
|
||||
DT_none = 0x00000000,
|
||||
DT_kinetic = 0x00000001,
|
||||
DT_energy = 0x00000002,
|
||||
DT_blast = 0x00000004,
|
||||
|
||||
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerBattlefieldMarkerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerBattlefieldMarkerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerBattlefieldMarkerObjectTemplate * base = dynamic_cast<const ServerBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerBattlefieldMarkerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerBuildingObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerBuildingObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerBuildingObjectTemplate * base = dynamic_cast<const ServerBuildingObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerBuildingObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerCellObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerCellObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerCellObjectTemplate * base = dynamic_cast<const ServerCellObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerCellObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerCityObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerCityObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerCityObjectTemplate * base = dynamic_cast<const ServerCityObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerCityObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerConstructionContractObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerConstructionContractObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerConstructionContractObjectTemplate * base = dynamic_cast<const ServerConstructionContractObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerConstructionContractObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+25
-25
@@ -17,8 +17,9 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
@@ -26,11 +27,9 @@
|
||||
ServerCreatureObjectTemplate::ServerCreatureObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerTangibleObjectTemplate(filename)
|
||||
, m_attribModsLoaded(false)
|
||||
, m_attribModsAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_attribModsLoaded(false)
|
||||
,m_attribModsAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerCreatureObjectTemplate::ServerCreatureObjectTemplate
|
||||
|
||||
@@ -39,7 +38,7 @@ ServerCreatureObjectTemplate::ServerCreatureObjectTemplate(const std::string & f
|
||||
*/
|
||||
ServerCreatureObjectTemplate::~ServerCreatureObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<StructParamOT *>::iterator iter;
|
||||
for (iter = m_attribMods.begin(); iter != m_attribMods.end(); ++iter)
|
||||
@@ -49,7 +48,7 @@ ServerCreatureObjectTemplate::~ServerCreatureObjectTemplate()
|
||||
}
|
||||
m_attribMods.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerCreatureObjectTemplate::~ServerCreatureObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -97,10 +96,10 @@ Tag ServerCreatureObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerCreatureObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerCreatureObjectTemplate * base = dynamic_cast<const ServerCreatureObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerCreatureObjectTemplate::getHighestTemplateVersion
|
||||
@@ -406,6 +405,7 @@ bool ServerCreatureObjectTemplate::isAppend(const char *name) const
|
||||
return ServerTangibleObjectTemplate::isAppend(name);
|
||||
} // ServerCreatureObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerCreatureObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "attributes") == 0)
|
||||
@@ -444,8 +444,8 @@ int ServerCreatureObjectTemplate::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerCreatureObjectTemplate::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() != ServerCreatureObjectTemplate_tag)
|
||||
{
|
||||
@@ -455,7 +455,7 @@ void ServerCreatureObjectTemplate::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();
|
||||
@@ -475,7 +475,7 @@ void ServerCreatureObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 5))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,5))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
@@ -614,18 +614,18 @@ void ServerCreatureObjectTemplate::load(Iff &file)
|
||||
*/
|
||||
void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerCreatureObjectTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D, E, R, V));
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0, 0, 0, 5));
|
||||
file.insertForm(TAG(0,0,0,5));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -642,7 +642,7 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
count = 6;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 6; ++i)
|
||||
m_attributes[i].saveToIff(file); }
|
||||
m_attributes[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save minAttributes
|
||||
@@ -651,7 +651,7 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
count = 6;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 6; ++i)
|
||||
m_minAttributes[i].saveToIff(file); }
|
||||
m_minAttributes[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save maxAttributes
|
||||
@@ -660,7 +660,7 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
count = 6;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 6; ++i)
|
||||
m_maxAttributes[i].saveToIff(file); }
|
||||
m_maxAttributes[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save minDrainModifier
|
||||
@@ -699,7 +699,7 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
count = m_attribMods.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_attribMods[i]->saveToIff(file); }
|
||||
m_attribMods[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save shockWounds
|
||||
@@ -732,7 +732,7 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
count = 4;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 4; ++i)
|
||||
m_maxMentalStates[i].saveToIff(file); }
|
||||
m_maxMentalStates[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save mentalStatesDecay
|
||||
@@ -741,7 +741,7 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
count = 4;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 4; ++i)
|
||||
m_mentalStatesDecay[i].saveToIff(file); }
|
||||
m_mentalStatesDecay[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
|
||||
@@ -756,4 +756,4 @@ void ServerCreatureObjectTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // ServerCreatureObjectTemplate::save
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
Executable → Regular
+34
-32
@@ -17,8 +17,9 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
@@ -26,15 +27,13 @@
|
||||
ServerDraftSchematicObjectTemplate::ServerDraftSchematicObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerIntangibleObjectTemplate(filename)
|
||||
, m_slotsLoaded(false)
|
||||
, m_slotsAppend(false)
|
||||
, m_skillCommandsLoaded(false)
|
||||
, m_skillCommandsAppend(false)
|
||||
, m_manufactureScriptsLoaded(false)
|
||||
, m_manufactureScriptsAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_slotsLoaded(false)
|
||||
,m_slotsAppend(false)
|
||||
,m_skillCommandsLoaded(false)
|
||||
,m_skillCommandsAppend(false)
|
||||
,m_manufactureScriptsLoaded(false)
|
||||
,m_manufactureScriptsAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerDraftSchematicObjectTemplate::ServerDraftSchematicObjectTemplate
|
||||
|
||||
@@ -43,7 +42,7 @@ ServerDraftSchematicObjectTemplate::ServerDraftSchematicObjectTemplate(const std
|
||||
*/
|
||||
ServerDraftSchematicObjectTemplate::~ServerDraftSchematicObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<StructParamOT *>::iterator iter;
|
||||
for (iter = m_slots.begin(); iter != m_slots.end(); ++iter)
|
||||
@@ -71,7 +70,7 @@ ServerDraftSchematicObjectTemplate::~ServerDraftSchematicObjectTemplate()
|
||||
}
|
||||
m_manufactureScripts.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerDraftSchematicObjectTemplate::~ServerDraftSchematicObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -119,10 +118,10 @@ Tag ServerDraftSchematicObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerDraftSchematicObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerDraftSchematicObjectTemplate * base = dynamic_cast<const ServerDraftSchematicObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerDraftSchematicObjectTemplate::getHighestTemplateVersion
|
||||
@@ -372,6 +371,7 @@ bool ServerDraftSchematicObjectTemplate::isAppend(const char *name) const
|
||||
return ServerIntangibleObjectTemplate::isAppend(name);
|
||||
} // ServerDraftSchematicObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerDraftSchematicObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "slots") == 0)
|
||||
@@ -398,8 +398,8 @@ int ServerDraftSchematicObjectTemplate::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerDraftSchematicObjectTemplate::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() != ServerDraftSchematicObjectTemplate_tag)
|
||||
{
|
||||
@@ -409,7 +409,7 @@ void ServerDraftSchematicObjectTemplate::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();
|
||||
@@ -429,7 +429,7 @@ void ServerDraftSchematicObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 7))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,7))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
@@ -532,18 +532,18 @@ void ServerDraftSchematicObjectTemplate::load(Iff &file)
|
||||
*/
|
||||
void ServerDraftSchematicObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerDraftSchematicObjectTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D, E, R, V));
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0, 0, 0, 7));
|
||||
file.insertForm(TAG(0,0,0,7));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -578,7 +578,7 @@ void ServerDraftSchematicObjectTemplate::save(Iff &file)
|
||||
count = m_slots.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_slots[i]->saveToIff(file); }
|
||||
m_slots[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
if (!m_skillCommandsLoaded)
|
||||
@@ -593,7 +593,7 @@ void ServerDraftSchematicObjectTemplate::save(Iff &file)
|
||||
count = m_skillCommands.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_skillCommands[i]->saveToIff(file); }
|
||||
m_skillCommands[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save destroyIngredients
|
||||
@@ -614,7 +614,7 @@ void ServerDraftSchematicObjectTemplate::save(Iff &file)
|
||||
count = m_manufactureScripts.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_manufactureScripts[i]->saveToIff(file); }
|
||||
m_manufactureScripts[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save itemsPerContainer
|
||||
@@ -647,6 +647,7 @@ void ServerDraftSchematicObjectTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // ServerDraftSchematicObjectTemplate::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerDraftSchematicObjectTemplate::_IngredientSlot
|
||||
|
||||
@@ -655,8 +656,8 @@ void ServerDraftSchematicObjectTemplate::save(Iff &file)
|
||||
*/
|
||||
ServerDraftSchematicObjectTemplate::_IngredientSlot::_IngredientSlot(const std::string & filename)
|
||||
: TpfTemplate(filename)
|
||||
, m_optionsLoaded(false)
|
||||
, m_optionsAppend(false)
|
||||
,m_optionsLoaded(false)
|
||||
,m_optionsAppend(false)
|
||||
{
|
||||
} // ServerDraftSchematicObjectTemplate::_IngredientSlot::_IngredientSlot
|
||||
|
||||
@@ -878,6 +879,7 @@ bool ServerDraftSchematicObjectTemplate::_IngredientSlot::isAppend(const char *n
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerDraftSchematicObjectTemplate::_IngredientSlot::isAppend
|
||||
|
||||
|
||||
int ServerDraftSchematicObjectTemplate::_IngredientSlot::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "options") == 0)
|
||||
@@ -896,8 +898,8 @@ int ServerDraftSchematicObjectTemplate::_IngredientSlot::getListLength(const cha
|
||||
*/
|
||||
void ServerDraftSchematicObjectTemplate::_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();
|
||||
|
||||
@@ -952,7 +954,7 @@ void ServerDraftSchematicObjectTemplate::_IngredientSlot::load(Iff &file)
|
||||
*/
|
||||
void ServerDraftSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_IngredientSlot_tag);
|
||||
|
||||
@@ -982,7 +984,7 @@ void ServerDraftSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
count = m_options.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_options[i]->saveToIff(file); }
|
||||
m_options[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save optionalSkillCommand
|
||||
@@ -1013,4 +1015,4 @@ void ServerDraftSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
file.exitForm(true);
|
||||
} // ServerDraftSchematicObjectTemplate::_IngredientSlot::save
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerFactoryObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerFactoryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerFactoryObjectTemplate * base = dynamic_cast<const ServerFactoryObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerFactoryObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerGroupObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerGroupObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerGroupObjectTemplate * base = dynamic_cast<const ServerGroupObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerGroupObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerGuildObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerGuildObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerGuildObjectTemplate * base = dynamic_cast<const ServerGuildObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerGuildObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerHarvesterInstallationObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerHarvesterInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerHarvesterInstallationObjectTemplate * base = dynamic_cast<const ServerHarvesterInstallationObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerHarvesterInstallationObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerInstallationObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerInstallationObjectTemplate * base = dynamic_cast<const ServerInstallationObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerInstallationObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerIntangibleObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerIntangibleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerIntangibleObjectTemplate * base = dynamic_cast<const ServerIntangibleObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerIntangibleObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerJediManagerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerJediManagerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerJediManagerObjectTemplate * base = dynamic_cast<const ServerJediManagerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerJediManagerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+3
-4
@@ -17,8 +17,7 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
@@ -86,10 +85,10 @@ Tag ServerManufactureInstallationObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerManufactureInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerManufactureInstallationObjectTemplate * base = dynamic_cast<const ServerManufactureInstallationObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerManufactureInstallationObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+28
-26
@@ -17,8 +17,9 @@
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
@@ -26,13 +27,11 @@
|
||||
ServerManufactureSchematicObjectTemplate::ServerManufactureSchematicObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerIntangibleObjectTemplate(filename)
|
||||
, m_ingredientsLoaded(false)
|
||||
, m_ingredientsAppend(false)
|
||||
, m_attributesLoaded(false)
|
||||
, m_attributesAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_ingredientsLoaded(false)
|
||||
,m_ingredientsAppend(false)
|
||||
,m_attributesLoaded(false)
|
||||
,m_attributesAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerManufactureSchematicObjectTemplate::ServerManufactureSchematicObjectTemplate
|
||||
|
||||
@@ -41,7 +40,7 @@ ServerManufactureSchematicObjectTemplate::ServerManufactureSchematicObjectTempla
|
||||
*/
|
||||
ServerManufactureSchematicObjectTemplate::~ServerManufactureSchematicObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<StructParamOT *>::iterator iter;
|
||||
for (iter = m_ingredients.begin(); iter != m_ingredients.end(); ++iter)
|
||||
@@ -60,7 +59,7 @@ ServerManufactureSchematicObjectTemplate::~ServerManufactureSchematicObjectTempl
|
||||
}
|
||||
m_attributes.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerManufactureSchematicObjectTemplate::~ServerManufactureSchematicObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -108,10 +107,10 @@ Tag ServerManufactureSchematicObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerManufactureSchematicObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerManufactureSchematicObjectTemplate * base = dynamic_cast<const ServerManufactureSchematicObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerManufactureSchematicObjectTemplate::getHighestTemplateVersion
|
||||
@@ -282,6 +281,7 @@ bool ServerManufactureSchematicObjectTemplate::isAppend(const char *name) const
|
||||
return ServerIntangibleObjectTemplate::isAppend(name);
|
||||
} // ServerManufactureSchematicObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerManufactureSchematicObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "ingredients") == 0)
|
||||
@@ -304,8 +304,8 @@ int ServerManufactureSchematicObjectTemplate::getListLength(const char *name) co
|
||||
*/
|
||||
void ServerManufactureSchematicObjectTemplate::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() != ServerManufactureSchematicObjectTemplate_tag)
|
||||
{
|
||||
@@ -315,7 +315,7 @@ void ServerManufactureSchematicObjectTemplate::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();
|
||||
@@ -335,7 +335,7 @@ void ServerManufactureSchematicObjectTemplate::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()));
|
||||
@@ -411,18 +411,18 @@ void ServerManufactureSchematicObjectTemplate::load(Iff &file)
|
||||
*/
|
||||
void ServerManufactureSchematicObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerManufactureSchematicObjectTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D, E, R, V));
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0, 0, 0, 0));
|
||||
file.insertForm(TAG(0,0,0,0));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -451,7 +451,7 @@ void ServerManufactureSchematicObjectTemplate::save(Iff &file)
|
||||
count = m_ingredients.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_ingredients[i]->saveToIff(file); }
|
||||
m_ingredients[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save itemCount
|
||||
@@ -472,7 +472,7 @@ void ServerManufactureSchematicObjectTemplate::save(Iff &file)
|
||||
count = m_attributes.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_attributes[i]->saveToIff(file); }
|
||||
m_attributes[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
|
||||
@@ -487,6 +487,7 @@ void ServerManufactureSchematicObjectTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // ServerManufactureSchematicObjectTemplate::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerManufactureSchematicObjectTemplate::_IngredientSlot
|
||||
|
||||
@@ -635,6 +636,7 @@ bool ServerManufactureSchematicObjectTemplate::_IngredientSlot::isAppend(const c
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerManufactureSchematicObjectTemplate::_IngredientSlot::isAppend
|
||||
|
||||
|
||||
int ServerManufactureSchematicObjectTemplate::_IngredientSlot::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -648,8 +650,8 @@ int ServerManufactureSchematicObjectTemplate::_IngredientSlot::getListLength(con
|
||||
*/
|
||||
void ServerManufactureSchematicObjectTemplate::_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();
|
||||
|
||||
@@ -679,7 +681,7 @@ void ServerManufactureSchematicObjectTemplate::_IngredientSlot::load(Iff &file)
|
||||
*/
|
||||
void ServerManufactureSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_IngredientSlot_tag);
|
||||
|
||||
@@ -708,4 +710,4 @@ void ServerManufactureSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // ServerManufactureSchematicObjectTemplate::_IngredientSlot::save
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
+266
@@ -0,0 +1,266 @@
|
||||
//========================================================================
|
||||
//
|
||||
// ServerMissionBoardObjectTemplate.cpp
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "sharedTemplate/FirstSharedTemplate.h"
|
||||
#include "sharedTemplateDefinition/TemplateData.h"
|
||||
#include "sharedTemplateDefinition/TemplateGlobals.h"
|
||||
#include "ServerMissionBoardObjectTemplate.h"
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
ServerMissionBoardObjectTemplate::ServerMissionBoardObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerUniverseObjectTemplate(filename)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerMissionBoardObjectTemplate::ServerMissionBoardObjectTemplate
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
ServerMissionBoardObjectTemplate::~ServerMissionBoardObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerMissionBoardObjectTemplate::~ServerMissionBoardObjectTemplate
|
||||
|
||||
/**
|
||||
* Static function used to register this template.
|
||||
*/
|
||||
void ServerMissionBoardObjectTemplate::registerMe(void)
|
||||
{
|
||||
ObjectTemplateList::registerTemplate(ServerMissionBoardObjectTemplate_tag, create);
|
||||
} // ServerMissionBoardObjectTemplate::registerMe
|
||||
|
||||
/**
|
||||
* Creates a ServerMissionBoardObjectTemplate template.
|
||||
*
|
||||
* @return a new instance of the template
|
||||
*/
|
||||
ObjectTemplate * ServerMissionBoardObjectTemplate::create(const std::string & filename)
|
||||
{
|
||||
return new ServerMissionBoardObjectTemplate(filename);
|
||||
} // ServerMissionBoardObjectTemplate::create
|
||||
|
||||
/**
|
||||
* Returns the template id.
|
||||
*
|
||||
* @return the template id
|
||||
*/
|
||||
Tag ServerMissionBoardObjectTemplate::getId(void) const
|
||||
{
|
||||
return ServerMissionBoardObjectTemplate_tag;
|
||||
} // ServerMissionBoardObjectTemplate::getId
|
||||
|
||||
/**
|
||||
* Returns this template's version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
Tag ServerMissionBoardObjectTemplate::getTemplateVersion(void) const
|
||||
{
|
||||
return m_templateVersion;
|
||||
} // ServerMissionBoardObjectTemplate::getTemplateVersion
|
||||
|
||||
/**
|
||||
* Returns the highest version of this template or it's base templates.
|
||||
*
|
||||
* @return the highest version
|
||||
*/
|
||||
Tag ServerMissionBoardObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const ServerMissionBoardObjectTemplate * base = dynamic_cast<const ServerMissionBoardObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerMissionBoardObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
CompilerIntegerParam * ServerMissionBoardObjectTemplate::getCompilerIntegerParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getCompilerIntegerParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getCompilerIntegerParam
|
||||
|
||||
FloatParam * ServerMissionBoardObjectTemplate::getFloatParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getFloatParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getFloatParam
|
||||
|
||||
BoolParam * ServerMissionBoardObjectTemplate::getBoolParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getBoolParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getBoolParam
|
||||
|
||||
StringParam * ServerMissionBoardObjectTemplate::getStringParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getStringParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getStringParam
|
||||
|
||||
StringIdParam * ServerMissionBoardObjectTemplate::getStringIdParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getStringIdParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getStringIdParam
|
||||
|
||||
VectorParam * ServerMissionBoardObjectTemplate::getVectorParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getVectorParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getVectorParam
|
||||
|
||||
DynamicVariableParam * ServerMissionBoardObjectTemplate::getDynamicVariableParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getDynamicVariableParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getDynamicVariableParam
|
||||
|
||||
StructParamOT * ServerMissionBoardObjectTemplate::getStructParamOT(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getStructParamOT(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getStructParamOT
|
||||
|
||||
TriggerVolumeParam * ServerMissionBoardObjectTemplate::getTriggerVolumeParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getTriggerVolumeParam(name, deepCheck, index);
|
||||
} //ServerMissionBoardObjectTemplate::getTriggerVolumeParam
|
||||
|
||||
void ServerMissionBoardObjectTemplate::initStructParamOT(StructParamOT ¶m, const char *name)
|
||||
{
|
||||
if (param.isInitialized())
|
||||
return;
|
||||
ServerUniverseObjectTemplate::initStructParamOT(param, name);
|
||||
} // ServerMissionBoardObjectTemplate::initStructParamOT
|
||||
|
||||
void ServerMissionBoardObjectTemplate::setAsEmptyList(const char *name)
|
||||
{
|
||||
ServerUniverseObjectTemplate::setAsEmptyList(name);
|
||||
} // ServerMissionBoardObjectTemplate::setAsEmptyList
|
||||
|
||||
void ServerMissionBoardObjectTemplate::setAppend(const char *name)
|
||||
{
|
||||
ServerUniverseObjectTemplate::setAppend(name);
|
||||
} // ServerMissionBoardObjectTemplate::setAppend
|
||||
|
||||
bool ServerMissionBoardObjectTemplate::isAppend(const char *name) const
|
||||
{
|
||||
return ServerUniverseObjectTemplate::isAppend(name);
|
||||
} // ServerMissionBoardObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerMissionBoardObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
return ServerUniverseObjectTemplate::getListLength(name);
|
||||
} // ServerMissionBoardObjectTemplate::getListLength
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
*
|
||||
* @param file file to load from
|
||||
*/
|
||||
void ServerMissionBoardObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != ServerMissionBoardObjectTemplate_tag)
|
||||
{
|
||||
ServerUniverseObjectTemplate::load(file);
|
||||
return;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
std::string baseFilename;
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
|
||||
file.enterChunk();
|
||||
int paramCount = file.read_int32();
|
||||
file.exitChunk();
|
||||
UNREF(paramName);
|
||||
UNREF(paramCount);
|
||||
|
||||
file.exitForm();
|
||||
ServerUniverseObjectTemplate::load(file);
|
||||
file.exitForm();
|
||||
return;
|
||||
} // ServerMissionBoardObjectTemplate::load
|
||||
|
||||
/**
|
||||
* Saves the template data to an iff file.
|
||||
*
|
||||
* @param file file to save to
|
||||
* @param location file type (client or server)
|
||||
*/
|
||||
void ServerMissionBoardObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerMissionBoardObjectTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0,0,0,0));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
|
||||
|
||||
// write number of parameters
|
||||
file.goToTopOfForm();
|
||||
file.insertChunk(TAG(P, C, N, T));
|
||||
file.insertChunkData(¶mCount, sizeof(paramCount));
|
||||
file.exitChunk();
|
||||
|
||||
file.exitForm(true);
|
||||
ServerUniverseObjectTemplate::save(file);
|
||||
file.exitForm();
|
||||
UNREF(count);
|
||||
} // ServerMissionBoardObjectTemplate::save
|
||||
|
||||
//@END TFD
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
//========================================================================
|
||||
//
|
||||
// ServerMissionBoardObjectTemplate.h
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_ServerMissionBoardObjectTemplate_H
|
||||
#define _INCLUDED_ServerMissionBoardObjectTemplate_H
|
||||
|
||||
#include "ServerUniverseObjectTemplate.h"
|
||||
#include "sharedFoundation/DynamicVariable.h"
|
||||
#include "sharedTemplateDefinition/TpfTemplate.h"
|
||||
|
||||
|
||||
class Vector;
|
||||
typedef StructParam<ObjectTemplate> StructParamOT;
|
||||
|
||||
|
||||
class ServerMissionBoardObjectTemplate : public ServerUniverseObjectTemplate
|
||||
{
|
||||
public:
|
||||
//@BEGIN TFD ID
|
||||
enum
|
||||
{
|
||||
ServerMissionBoardObjectTemplate_tag = TAG(M,I,S,B)
|
||||
};
|
||||
//@END TFD ID
|
||||
public:
|
||||
ServerMissionBoardObjectTemplate(const std::string & filename);
|
||||
virtual ~ServerMissionBoardObjectTemplate();
|
||||
|
||||
virtual Tag getId(void) const;
|
||||
virtual Tag getTemplateVersion(void) const;
|
||||
virtual Tag getHighestTemplateVersion(void) const;
|
||||
static void install(void);
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
virtual CompilerIntegerParam *getCompilerIntegerParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual FloatParam *getFloatParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual BoolParam *getBoolParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StringParam *getStringParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StringIdParam *getStringIdParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual VectorParam *getVectorParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual DynamicVariableParam *getDynamicVariableParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StructParamOT *getStructParamOT(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual TriggerVolumeParam *getTriggerVolumeParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual void initStructParamOT(StructParamOT ¶m, const char *name);
|
||||
virtual void setAsEmptyList(const char *name);
|
||||
virtual void setAppend(const char *name);
|
||||
virtual bool isAppend(const char *name) const;
|
||||
virtual int getListLength(const char *name) const;
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
virtual void save(Iff &file);
|
||||
|
||||
private:
|
||||
//@END TFD
|
||||
|
||||
private:
|
||||
Tag m_templateVersion; // the template version
|
||||
bool m_versionOk; // flag that the template version loaded is the one we expect
|
||||
|
||||
static void registerMe(void);
|
||||
static ObjectTemplate * create(const std::string & filename);
|
||||
|
||||
// no copying
|
||||
ServerMissionBoardObjectTemplate(const ServerMissionBoardObjectTemplate &);
|
||||
ServerMissionBoardObjectTemplate & operator =(const ServerMissionBoardObjectTemplate &);
|
||||
};
|
||||
|
||||
|
||||
inline void ServerMissionBoardObjectTemplate::install(void)
|
||||
{
|
||||
//@BEGIN TFD INSTALL
|
||||
ServerMissionBoardObjectTemplate::registerMe();
|
||||
//@END TFD INSTALL
|
||||
}
|
||||
|
||||
|
||||
#endif // _INCLUDED_ServerMissionBoardObjectTemplate_H
|
||||
+266
@@ -0,0 +1,266 @@
|
||||
//========================================================================
|
||||
//
|
||||
// ServerMissionDataObjectTemplate.cpp
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "sharedTemplate/FirstSharedTemplate.h"
|
||||
#include "sharedTemplateDefinition/TemplateData.h"
|
||||
#include "sharedTemplateDefinition/TemplateGlobals.h"
|
||||
#include "ServerMissionDataObjectTemplate.h"
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
ServerMissionDataObjectTemplate::ServerMissionDataObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerIntangibleObjectTemplate(filename)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerMissionDataObjectTemplate::ServerMissionDataObjectTemplate
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
ServerMissionDataObjectTemplate::~ServerMissionDataObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerMissionDataObjectTemplate::~ServerMissionDataObjectTemplate
|
||||
|
||||
/**
|
||||
* Static function used to register this template.
|
||||
*/
|
||||
void ServerMissionDataObjectTemplate::registerMe(void)
|
||||
{
|
||||
ObjectTemplateList::registerTemplate(ServerMissionDataObjectTemplate_tag, create);
|
||||
} // ServerMissionDataObjectTemplate::registerMe
|
||||
|
||||
/**
|
||||
* Creates a ServerMissionDataObjectTemplate template.
|
||||
*
|
||||
* @return a new instance of the template
|
||||
*/
|
||||
ObjectTemplate * ServerMissionDataObjectTemplate::create(const std::string & filename)
|
||||
{
|
||||
return new ServerMissionDataObjectTemplate(filename);
|
||||
} // ServerMissionDataObjectTemplate::create
|
||||
|
||||
/**
|
||||
* Returns the template id.
|
||||
*
|
||||
* @return the template id
|
||||
*/
|
||||
Tag ServerMissionDataObjectTemplate::getId(void) const
|
||||
{
|
||||
return ServerMissionDataObjectTemplate_tag;
|
||||
} // ServerMissionDataObjectTemplate::getId
|
||||
|
||||
/**
|
||||
* Returns this template's version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
Tag ServerMissionDataObjectTemplate::getTemplateVersion(void) const
|
||||
{
|
||||
return m_templateVersion;
|
||||
} // ServerMissionDataObjectTemplate::getTemplateVersion
|
||||
|
||||
/**
|
||||
* Returns the highest version of this template or it's base templates.
|
||||
*
|
||||
* @return the highest version
|
||||
*/
|
||||
Tag ServerMissionDataObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const ServerMissionDataObjectTemplate * base = dynamic_cast<const ServerMissionDataObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerMissionDataObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
CompilerIntegerParam * ServerMissionDataObjectTemplate::getCompilerIntegerParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getCompilerIntegerParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getCompilerIntegerParam
|
||||
|
||||
FloatParam * ServerMissionDataObjectTemplate::getFloatParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getFloatParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getFloatParam
|
||||
|
||||
BoolParam * ServerMissionDataObjectTemplate::getBoolParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getBoolParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getBoolParam
|
||||
|
||||
StringParam * ServerMissionDataObjectTemplate::getStringParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getStringParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getStringParam
|
||||
|
||||
StringIdParam * ServerMissionDataObjectTemplate::getStringIdParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getStringIdParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getStringIdParam
|
||||
|
||||
VectorParam * ServerMissionDataObjectTemplate::getVectorParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getVectorParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getVectorParam
|
||||
|
||||
DynamicVariableParam * ServerMissionDataObjectTemplate::getDynamicVariableParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getDynamicVariableParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getDynamicVariableParam
|
||||
|
||||
StructParamOT * ServerMissionDataObjectTemplate::getStructParamOT(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getStructParamOT(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getStructParamOT
|
||||
|
||||
TriggerVolumeParam * ServerMissionDataObjectTemplate::getTriggerVolumeParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getTriggerVolumeParam(name, deepCheck, index);
|
||||
} //ServerMissionDataObjectTemplate::getTriggerVolumeParam
|
||||
|
||||
void ServerMissionDataObjectTemplate::initStructParamOT(StructParamOT ¶m, const char *name)
|
||||
{
|
||||
if (param.isInitialized())
|
||||
return;
|
||||
ServerIntangibleObjectTemplate::initStructParamOT(param, name);
|
||||
} // ServerMissionDataObjectTemplate::initStructParamOT
|
||||
|
||||
void ServerMissionDataObjectTemplate::setAsEmptyList(const char *name)
|
||||
{
|
||||
ServerIntangibleObjectTemplate::setAsEmptyList(name);
|
||||
} // ServerMissionDataObjectTemplate::setAsEmptyList
|
||||
|
||||
void ServerMissionDataObjectTemplate::setAppend(const char *name)
|
||||
{
|
||||
ServerIntangibleObjectTemplate::setAppend(name);
|
||||
} // ServerMissionDataObjectTemplate::setAppend
|
||||
|
||||
bool ServerMissionDataObjectTemplate::isAppend(const char *name) const
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::isAppend(name);
|
||||
} // ServerMissionDataObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerMissionDataObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getListLength(name);
|
||||
} // ServerMissionDataObjectTemplate::getListLength
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
*
|
||||
* @param file file to load from
|
||||
*/
|
||||
void ServerMissionDataObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != ServerMissionDataObjectTemplate_tag)
|
||||
{
|
||||
ServerIntangibleObjectTemplate::load(file);
|
||||
return;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
std::string baseFilename;
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
|
||||
file.enterChunk();
|
||||
int paramCount = file.read_int32();
|
||||
file.exitChunk();
|
||||
UNREF(paramName);
|
||||
UNREF(paramCount);
|
||||
|
||||
file.exitForm();
|
||||
ServerIntangibleObjectTemplate::load(file);
|
||||
file.exitForm();
|
||||
return;
|
||||
} // ServerMissionDataObjectTemplate::load
|
||||
|
||||
/**
|
||||
* Saves the template data to an iff file.
|
||||
*
|
||||
* @param file file to save to
|
||||
* @param location file type (client or server)
|
||||
*/
|
||||
void ServerMissionDataObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerMissionDataObjectTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0,0,0,0));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
|
||||
|
||||
// write number of parameters
|
||||
file.goToTopOfForm();
|
||||
file.insertChunk(TAG(P, C, N, T));
|
||||
file.insertChunkData(¶mCount, sizeof(paramCount));
|
||||
file.exitChunk();
|
||||
|
||||
file.exitForm(true);
|
||||
ServerIntangibleObjectTemplate::save(file);
|
||||
file.exitForm();
|
||||
UNREF(count);
|
||||
} // ServerMissionDataObjectTemplate::save
|
||||
|
||||
//@END TFD
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
//========================================================================
|
||||
//
|
||||
// ServerMissionDataObjectTemplate.h
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_ServerMissionDataObjectTemplate_H
|
||||
#define _INCLUDED_ServerMissionDataObjectTemplate_H
|
||||
|
||||
#include "ServerIntangibleObjectTemplate.h"
|
||||
#include "sharedFoundation/DynamicVariable.h"
|
||||
#include "sharedTemplateDefinition/TpfTemplate.h"
|
||||
|
||||
|
||||
class Vector;
|
||||
typedef StructParam<ObjectTemplate> StructParamOT;
|
||||
|
||||
|
||||
class ServerMissionDataObjectTemplate : public ServerIntangibleObjectTemplate
|
||||
{
|
||||
public:
|
||||
//@BEGIN TFD ID
|
||||
enum
|
||||
{
|
||||
ServerMissionDataObjectTemplate_tag = TAG(M,I,S,D)
|
||||
};
|
||||
//@END TFD ID
|
||||
public:
|
||||
ServerMissionDataObjectTemplate(const std::string & filename);
|
||||
virtual ~ServerMissionDataObjectTemplate();
|
||||
|
||||
virtual Tag getId(void) const;
|
||||
virtual Tag getTemplateVersion(void) const;
|
||||
virtual Tag getHighestTemplateVersion(void) const;
|
||||
static void install(void);
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
virtual CompilerIntegerParam *getCompilerIntegerParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual FloatParam *getFloatParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual BoolParam *getBoolParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StringParam *getStringParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StringIdParam *getStringIdParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual VectorParam *getVectorParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual DynamicVariableParam *getDynamicVariableParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StructParamOT *getStructParamOT(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual TriggerVolumeParam *getTriggerVolumeParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual void initStructParamOT(StructParamOT ¶m, const char *name);
|
||||
virtual void setAsEmptyList(const char *name);
|
||||
virtual void setAppend(const char *name);
|
||||
virtual bool isAppend(const char *name) const;
|
||||
virtual int getListLength(const char *name) const;
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
virtual void save(Iff &file);
|
||||
|
||||
private:
|
||||
//@END TFD
|
||||
|
||||
private:
|
||||
Tag m_templateVersion; // the template version
|
||||
bool m_versionOk; // flag that the template version loaded is the one we expect
|
||||
|
||||
static void registerMe(void);
|
||||
static ObjectTemplate * create(const std::string & filename);
|
||||
|
||||
// no copying
|
||||
ServerMissionDataObjectTemplate(const ServerMissionDataObjectTemplate &);
|
||||
ServerMissionDataObjectTemplate & operator =(const ServerMissionDataObjectTemplate &);
|
||||
};
|
||||
|
||||
|
||||
inline void ServerMissionDataObjectTemplate::install(void)
|
||||
{
|
||||
//@BEGIN TFD INSTALL
|
||||
ServerMissionDataObjectTemplate::registerMe();
|
||||
//@END TFD INSTALL
|
||||
}
|
||||
|
||||
|
||||
#endif // _INCLUDED_ServerMissionDataObjectTemplate_H
|
||||
+266
@@ -0,0 +1,266 @@
|
||||
//========================================================================
|
||||
//
|
||||
// ServerMissionListEntryObjectTemplate.cpp
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "sharedTemplate/FirstSharedTemplate.h"
|
||||
#include "sharedTemplateDefinition/TemplateData.h"
|
||||
#include "sharedTemplateDefinition/TemplateGlobals.h"
|
||||
#include "ServerMissionListEntryObjectTemplate.h"
|
||||
#include "sharedDebug/DataLint.h"
|
||||
#include "sharedFile/Iff.h"
|
||||
#include "sharedTemplateDefinition/ObjectTemplate.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
ServerMissionListEntryObjectTemplate::ServerMissionListEntryObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerIntangibleObjectTemplate(filename)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerMissionListEntryObjectTemplate::ServerMissionListEntryObjectTemplate
|
||||
|
||||
/**
|
||||
* Class destructor.
|
||||
*/
|
||||
ServerMissionListEntryObjectTemplate::~ServerMissionListEntryObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerMissionListEntryObjectTemplate::~ServerMissionListEntryObjectTemplate
|
||||
|
||||
/**
|
||||
* Static function used to register this template.
|
||||
*/
|
||||
void ServerMissionListEntryObjectTemplate::registerMe(void)
|
||||
{
|
||||
ObjectTemplateList::registerTemplate(ServerMissionListEntryObjectTemplate_tag, create);
|
||||
} // ServerMissionListEntryObjectTemplate::registerMe
|
||||
|
||||
/**
|
||||
* Creates a ServerMissionListEntryObjectTemplate template.
|
||||
*
|
||||
* @return a new instance of the template
|
||||
*/
|
||||
ObjectTemplate * ServerMissionListEntryObjectTemplate::create(const std::string & filename)
|
||||
{
|
||||
return new ServerMissionListEntryObjectTemplate(filename);
|
||||
} // ServerMissionListEntryObjectTemplate::create
|
||||
|
||||
/**
|
||||
* Returns the template id.
|
||||
*
|
||||
* @return the template id
|
||||
*/
|
||||
Tag ServerMissionListEntryObjectTemplate::getId(void) const
|
||||
{
|
||||
return ServerMissionListEntryObjectTemplate_tag;
|
||||
} // ServerMissionListEntryObjectTemplate::getId
|
||||
|
||||
/**
|
||||
* Returns this template's version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
Tag ServerMissionListEntryObjectTemplate::getTemplateVersion(void) const
|
||||
{
|
||||
return m_templateVersion;
|
||||
} // ServerMissionListEntryObjectTemplate::getTemplateVersion
|
||||
|
||||
/**
|
||||
* Returns the highest version of this template or it's base templates.
|
||||
*
|
||||
* @return the highest version
|
||||
*/
|
||||
Tag ServerMissionListEntryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const ServerMissionListEntryObjectTemplate * base = dynamic_cast<const ServerMissionListEntryObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerMissionListEntryObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
//@BEGIN TFD
|
||||
CompilerIntegerParam * ServerMissionListEntryObjectTemplate::getCompilerIntegerParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getCompilerIntegerParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getCompilerIntegerParam
|
||||
|
||||
FloatParam * ServerMissionListEntryObjectTemplate::getFloatParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getFloatParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getFloatParam
|
||||
|
||||
BoolParam * ServerMissionListEntryObjectTemplate::getBoolParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getBoolParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getBoolParam
|
||||
|
||||
StringParam * ServerMissionListEntryObjectTemplate::getStringParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getStringParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getStringParam
|
||||
|
||||
StringIdParam * ServerMissionListEntryObjectTemplate::getStringIdParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getStringIdParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getStringIdParam
|
||||
|
||||
VectorParam * ServerMissionListEntryObjectTemplate::getVectorParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getVectorParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getVectorParam
|
||||
|
||||
DynamicVariableParam * ServerMissionListEntryObjectTemplate::getDynamicVariableParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getDynamicVariableParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getDynamicVariableParam
|
||||
|
||||
StructParamOT * ServerMissionListEntryObjectTemplate::getStructParamOT(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getStructParamOT(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getStructParamOT
|
||||
|
||||
TriggerVolumeParam * ServerMissionListEntryObjectTemplate::getTriggerVolumeParam(const char *name, bool deepCheck, int index)
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getTriggerVolumeParam(name, deepCheck, index);
|
||||
} //ServerMissionListEntryObjectTemplate::getTriggerVolumeParam
|
||||
|
||||
void ServerMissionListEntryObjectTemplate::initStructParamOT(StructParamOT ¶m, const char *name)
|
||||
{
|
||||
if (param.isInitialized())
|
||||
return;
|
||||
ServerIntangibleObjectTemplate::initStructParamOT(param, name);
|
||||
} // ServerMissionListEntryObjectTemplate::initStructParamOT
|
||||
|
||||
void ServerMissionListEntryObjectTemplate::setAsEmptyList(const char *name)
|
||||
{
|
||||
ServerIntangibleObjectTemplate::setAsEmptyList(name);
|
||||
} // ServerMissionListEntryObjectTemplate::setAsEmptyList
|
||||
|
||||
void ServerMissionListEntryObjectTemplate::setAppend(const char *name)
|
||||
{
|
||||
ServerIntangibleObjectTemplate::setAppend(name);
|
||||
} // ServerMissionListEntryObjectTemplate::setAppend
|
||||
|
||||
bool ServerMissionListEntryObjectTemplate::isAppend(const char *name) const
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::isAppend(name);
|
||||
} // ServerMissionListEntryObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerMissionListEntryObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
return ServerIntangibleObjectTemplate::getListLength(name);
|
||||
} // ServerMissionListEntryObjectTemplate::getListLength
|
||||
|
||||
/**
|
||||
* Loads the template data from an iff file. We should already be in the form
|
||||
* for this template.
|
||||
*
|
||||
* @param file file to load from
|
||||
*/
|
||||
void ServerMissionListEntryObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != ServerMissionListEntryObjectTemplate_tag)
|
||||
{
|
||||
ServerIntangibleObjectTemplate::load(file);
|
||||
return;
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
std::string baseFilename;
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
}
|
||||
|
||||
file.enterForm();
|
||||
|
||||
file.enterChunk();
|
||||
int paramCount = file.read_int32();
|
||||
file.exitChunk();
|
||||
UNREF(paramName);
|
||||
UNREF(paramCount);
|
||||
|
||||
file.exitForm();
|
||||
ServerIntangibleObjectTemplate::load(file);
|
||||
file.exitForm();
|
||||
return;
|
||||
} // ServerMissionListEntryObjectTemplate::load
|
||||
|
||||
/**
|
||||
* Saves the template data to an iff file.
|
||||
*
|
||||
* @param file file to save to
|
||||
* @param location file type (client or server)
|
||||
*/
|
||||
void ServerMissionListEntryObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerMissionListEntryObjectTemplate_tag);
|
||||
if (m_baseTemplateName.size() != 0)
|
||||
{
|
||||
file.insertForm(TAG(D,E,R,V));
|
||||
file.insertChunk(TAG(X, X, X, X));
|
||||
file.insertChunkData(m_baseTemplateName.c_str(), m_baseTemplateName.size() + 1);
|
||||
file.exitChunk();
|
||||
file.exitForm();
|
||||
}
|
||||
file.insertForm(TAG(0,0,0,0));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
|
||||
|
||||
// write number of parameters
|
||||
file.goToTopOfForm();
|
||||
file.insertChunk(TAG(P, C, N, T));
|
||||
file.insertChunkData(¶mCount, sizeof(paramCount));
|
||||
file.exitChunk();
|
||||
|
||||
file.exitForm(true);
|
||||
ServerIntangibleObjectTemplate::save(file);
|
||||
file.exitForm();
|
||||
UNREF(count);
|
||||
} // ServerMissionListEntryObjectTemplate::save
|
||||
|
||||
//@END TFD
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
//========================================================================
|
||||
//
|
||||
// ServerMissionListEntryObjectTemplate.h
|
||||
//
|
||||
//IMPORTANT: Any code between //@BEGIN TFD... and //@END TFD... will be
|
||||
//overwritten the next time the template definition is compiled. Do not
|
||||
//make changes to code inside these blocks.
|
||||
//
|
||||
// copyright 2001 Sony Online Entertainment
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _INCLUDED_ServerMissionListEntryObjectTemplate_H
|
||||
#define _INCLUDED_ServerMissionListEntryObjectTemplate_H
|
||||
|
||||
#include "ServerIntangibleObjectTemplate.h"
|
||||
#include "sharedFoundation/DynamicVariable.h"
|
||||
#include "sharedTemplateDefinition/TpfTemplate.h"
|
||||
|
||||
|
||||
class Vector;
|
||||
typedef StructParam<ObjectTemplate> StructParamOT;
|
||||
|
||||
|
||||
class ServerMissionListEntryObjectTemplate : public ServerIntangibleObjectTemplate
|
||||
{
|
||||
public:
|
||||
//@BEGIN TFD ID
|
||||
enum
|
||||
{
|
||||
ServerMissionListEntryObjectTemplate_tag = TAG(M,L,E,O)
|
||||
};
|
||||
//@END TFD ID
|
||||
public:
|
||||
ServerMissionListEntryObjectTemplate(const std::string & filename);
|
||||
virtual ~ServerMissionListEntryObjectTemplate();
|
||||
|
||||
virtual Tag getId(void) const;
|
||||
virtual Tag getTemplateVersion(void) const;
|
||||
virtual Tag getHighestTemplateVersion(void) const;
|
||||
static void install(void);
|
||||
|
||||
//@BEGIN TFD
|
||||
public:
|
||||
virtual CompilerIntegerParam *getCompilerIntegerParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual FloatParam *getFloatParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual BoolParam *getBoolParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StringParam *getStringParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StringIdParam *getStringIdParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual VectorParam *getVectorParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual DynamicVariableParam *getDynamicVariableParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual StructParamOT *getStructParamOT(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual TriggerVolumeParam *getTriggerVolumeParam(const char *name, bool deepCheck = true, int index = 0);
|
||||
virtual void initStructParamOT(StructParamOT ¶m, const char *name);
|
||||
virtual void setAsEmptyList(const char *name);
|
||||
virtual void setAppend(const char *name);
|
||||
virtual bool isAppend(const char *name) const;
|
||||
virtual int getListLength(const char *name) const;
|
||||
|
||||
protected:
|
||||
virtual void load(Iff &file);
|
||||
virtual void save(Iff &file);
|
||||
|
||||
private:
|
||||
//@END TFD
|
||||
|
||||
private:
|
||||
Tag m_templateVersion; // the template version
|
||||
bool m_versionOk; // flag that the template version loaded is the one we expect
|
||||
|
||||
static void registerMe(void);
|
||||
static ObjectTemplate * create(const std::string & filename);
|
||||
|
||||
// no copying
|
||||
ServerMissionListEntryObjectTemplate(const ServerMissionListEntryObjectTemplate &);
|
||||
ServerMissionListEntryObjectTemplate & operator =(const ServerMissionListEntryObjectTemplate &);
|
||||
};
|
||||
|
||||
|
||||
inline void ServerMissionListEntryObjectTemplate::install(void)
|
||||
{
|
||||
//@BEGIN TFD INSTALL
|
||||
ServerMissionListEntryObjectTemplate::registerMe();
|
||||
//@END TFD INSTALL
|
||||
}
|
||||
|
||||
|
||||
#endif // _INCLUDED_ServerMissionListEntryObjectTemplate_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user