mirror of
https://github.com/SWG-Source/src.git
synced 2026-10-16 08:13:31 -04:00
re-add and add some missing tdf templates, fix build_tdf.sh
This commit is contained in:
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
|
||||
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 ServerMissionObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerMissionObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerMissionObjectTemplate * base = dynamic_cast<const ServerMissionObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerMissionObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+56
-48
@@ -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,21 +27,19 @@
|
||||
ServerObjectTemplate::ServerObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: TpfTemplate(filename)
|
||||
, m_scriptsLoaded(false)
|
||||
, m_scriptsAppend(false)
|
||||
, m_visibleFlagsLoaded(false)
|
||||
, m_visibleFlagsAppend(false)
|
||||
, m_deleteFlagsLoaded(false)
|
||||
, m_deleteFlagsAppend(false)
|
||||
, m_moveFlagsLoaded(false)
|
||||
, m_moveFlagsAppend(false)
|
||||
, m_contentsLoaded(false)
|
||||
, m_contentsAppend(false)
|
||||
, m_xpPointsLoaded(false)
|
||||
, m_xpPointsAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_scriptsLoaded(false)
|
||||
,m_scriptsAppend(false)
|
||||
,m_visibleFlagsLoaded(false)
|
||||
,m_visibleFlagsAppend(false)
|
||||
,m_deleteFlagsLoaded(false)
|
||||
,m_deleteFlagsAppend(false)
|
||||
,m_moveFlagsLoaded(false)
|
||||
,m_moveFlagsAppend(false)
|
||||
,m_contentsLoaded(false)
|
||||
,m_contentsAppend(false)
|
||||
,m_xpPointsLoaded(false)
|
||||
,m_xpPointsAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerObjectTemplate::ServerObjectTemplate
|
||||
|
||||
@@ -49,7 +48,7 @@ ServerObjectTemplate::ServerObjectTemplate(const std::string & filename)
|
||||
*/
|
||||
ServerObjectTemplate::~ServerObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<StringParam *>::iterator iter;
|
||||
for (iter = m_scripts.begin(); iter != m_scripts.end(); ++iter)
|
||||
@@ -104,7 +103,7 @@ ServerObjectTemplate::~ServerObjectTemplate()
|
||||
}
|
||||
m_xpPoints.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerObjectTemplate::~ServerObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -152,10 +151,10 @@ Tag ServerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerObjectTemplate * base = dynamic_cast<const ServerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerObjectTemplate::getHighestTemplateVersion
|
||||
@@ -500,6 +499,7 @@ bool ServerObjectTemplate::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "scripts") == 0)
|
||||
@@ -542,8 +542,8 @@ int ServerObjectTemplate::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerObjectTemplate::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() != ServerObjectTemplate_tag)
|
||||
{
|
||||
@@ -553,7 +553,7 @@ void ServerObjectTemplate::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();
|
||||
@@ -573,7 +573,7 @@ void ServerObjectTemplate::load(Iff &file)
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 1, 1))
|
||||
if (getHighestTemplateVersion() != TAG(0,0,1,1))
|
||||
{
|
||||
if (DataLint::isEnabled())
|
||||
DEBUG_WARNING(true, ("template %s version out of date", file.getFileName()));
|
||||
@@ -749,18 +749,18 @@ void ServerObjectTemplate::load(Iff &file)
|
||||
*/
|
||||
void ServerObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerObjectTemplate_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, 1, 1));
|
||||
file.insertForm(TAG(0,0,1,1));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -783,7 +783,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = m_scripts.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_scripts[i]->saveToIff(file); }
|
||||
m_scripts[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save objvars
|
||||
@@ -810,7 +810,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = m_visibleFlags.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_visibleFlags[i]->saveToIff(file); }
|
||||
m_visibleFlags[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
if (!m_deleteFlagsLoaded)
|
||||
@@ -825,7 +825,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = m_deleteFlags.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_deleteFlags[i]->saveToIff(file); }
|
||||
m_deleteFlags[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
if (!m_moveFlagsLoaded)
|
||||
@@ -840,7 +840,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = m_moveFlags.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_moveFlags[i]->saveToIff(file); }
|
||||
m_moveFlags[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save invulnerable
|
||||
@@ -867,7 +867,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = 3;
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < 3; ++i)
|
||||
m_updateRanges[i].saveToIff(file); }
|
||||
m_updateRanges[i].saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
if (!m_contentsLoaded)
|
||||
@@ -882,7 +882,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = m_contents.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_contents[i]->saveToIff(file); }
|
||||
m_contents[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
if (!m_xpPointsLoaded)
|
||||
@@ -897,7 +897,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
count = m_xpPoints.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_xpPoints[i]->saveToIff(file); }
|
||||
m_xpPoints[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save persistByDefault
|
||||
@@ -924,6 +924,7 @@ void ServerObjectTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // ServerObjectTemplate::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerObjectTemplate::_AttribMod
|
||||
|
||||
@@ -1111,6 +1112,7 @@ bool ServerObjectTemplate::_AttribMod::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerObjectTemplate::_AttribMod::isAppend
|
||||
|
||||
|
||||
int ServerObjectTemplate::_AttribMod::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -1124,8 +1126,8 @@ int ServerObjectTemplate::_AttribMod::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerObjectTemplate::_AttribMod::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();
|
||||
|
||||
@@ -1161,7 +1163,7 @@ void ServerObjectTemplate::_AttribMod::load(Iff &file)
|
||||
*/
|
||||
void ServerObjectTemplate::_AttribMod::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_AttribMod_tag);
|
||||
|
||||
@@ -1208,6 +1210,7 @@ void ServerObjectTemplate::_AttribMod::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // ServerObjectTemplate::_AttribMod::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerObjectTemplate::_Contents
|
||||
|
||||
@@ -1367,6 +1370,7 @@ bool ServerObjectTemplate::_Contents::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerObjectTemplate::_Contents::isAppend
|
||||
|
||||
|
||||
int ServerObjectTemplate::_Contents::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -1380,8 +1384,8 @@ int ServerObjectTemplate::_Contents::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerObjectTemplate::_Contents::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();
|
||||
|
||||
@@ -1413,7 +1417,7 @@ void ServerObjectTemplate::_Contents::load(Iff &file)
|
||||
*/
|
||||
void ServerObjectTemplate::_Contents::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_Contents_tag);
|
||||
|
||||
@@ -1448,6 +1452,7 @@ void ServerObjectTemplate::_Contents::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // ServerObjectTemplate::_Contents::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerObjectTemplate::_MentalStateMod
|
||||
|
||||
@@ -1635,6 +1640,7 @@ bool ServerObjectTemplate::_MentalStateMod::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerObjectTemplate::_MentalStateMod::isAppend
|
||||
|
||||
|
||||
int ServerObjectTemplate::_MentalStateMod::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -1648,8 +1654,8 @@ int ServerObjectTemplate::_MentalStateMod::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerObjectTemplate::_MentalStateMod::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();
|
||||
|
||||
@@ -1685,7 +1691,7 @@ void ServerObjectTemplate::_MentalStateMod::load(Iff &file)
|
||||
*/
|
||||
void ServerObjectTemplate::_MentalStateMod::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_MentalStateMod_tag);
|
||||
|
||||
@@ -1732,6 +1738,7 @@ void ServerObjectTemplate::_MentalStateMod::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // ServerObjectTemplate::_MentalStateMod::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class ServerObjectTemplate::_Xp
|
||||
|
||||
@@ -1889,6 +1896,7 @@ bool ServerObjectTemplate::_Xp::isAppend(const char *name) const
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // ServerObjectTemplate::_Xp::isAppend
|
||||
|
||||
|
||||
int ServerObjectTemplate::_Xp::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -1902,8 +1910,8 @@ int ServerObjectTemplate::_Xp::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerObjectTemplate::_Xp::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();
|
||||
|
||||
@@ -1935,7 +1943,7 @@ void ServerObjectTemplate::_Xp::load(Iff &file)
|
||||
*/
|
||||
void ServerObjectTemplate::_Xp::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_Xp_tag);
|
||||
|
||||
@@ -1970,4 +1978,4 @@ void ServerObjectTemplate::_Xp::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // ServerObjectTemplate::_Xp::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 ServerPlanetObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerPlanetObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerPlanetObjectTemplate * base = dynamic_cast<const ServerPlanetObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerPlanetObjectTemplate::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 ServerPlayerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerPlayerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerPlayerObjectTemplate * base = dynamic_cast<const ServerPlayerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerPlayerObjectTemplate::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 ServerPlayerQuestObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerPlayerQuestObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerPlayerQuestObjectTemplate * base = dynamic_cast<const ServerPlayerQuestObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerPlayerQuestObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+18
-19
@@ -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 ServerResourceClassObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerResourceClassObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerResourceClassObjectTemplate * base = dynamic_cast<const ServerResourceClassObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerResourceClassObjectTemplate::getHighestTemplateVersion
|
||||
@@ -103,9 +102,9 @@ CompilerIntegerParam * ServerResourceClassObjectTemplate::getCompilerIntegerPara
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_numTypes;
|
||||
}
|
||||
@@ -117,9 +116,9 @@ CompilerIntegerParam * ServerResourceClassObjectTemplate::getCompilerIntegerPara
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_minTypes;
|
||||
}
|
||||
@@ -131,9 +130,9 @@ CompilerIntegerParam * ServerResourceClassObjectTemplate::getCompilerIntegerPara
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_maxTypes;
|
||||
}
|
||||
@@ -141,7 +140,7 @@ CompilerIntegerParam * ServerResourceClassObjectTemplate::getCompilerIntegerPara
|
||||
}
|
||||
else
|
||||
return ServerUniverseObjectTemplate::getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
} //ServerResourceClassObjectTemplate::getCompilerIntegerParam
|
||||
|
||||
FloatParam * ServerResourceClassObjectTemplate::getFloatParam(const char *name, bool deepCheck, int index)
|
||||
@@ -162,9 +161,9 @@ StringParam * ServerResourceClassObjectTemplate::getStringParam(const char *name
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getStringParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_resourceClassName;
|
||||
}
|
||||
@@ -176,9 +175,9 @@ StringParam * ServerResourceClassObjectTemplate::getStringParam(const char *name
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getStringParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_parentClass;
|
||||
}
|
||||
@@ -186,7 +185,7 @@ StringParam * ServerResourceClassObjectTemplate::getStringParam(const char *name
|
||||
}
|
||||
else
|
||||
return ServerUniverseObjectTemplate::getStringParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
} //ServerResourceClassObjectTemplate::getStringParam
|
||||
|
||||
StringIdParam * ServerResourceClassObjectTemplate::getStringIdParam(const char *name, bool deepCheck, int index)
|
||||
@@ -269,12 +268,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
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)
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
if (m_baseData != NULL)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
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 ServerResourceContainerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerResourceContainerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerResourceContainerObjectTemplate * base = dynamic_cast<const ServerResourceContainerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerResourceContainerObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+11
-12
@@ -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 ServerResourcePoolObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerResourcePoolObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerResourcePoolObjectTemplate * base = dynamic_cast<const ServerResourcePoolObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerResourcePoolObjectTemplate::getHighestTemplateVersion
|
||||
@@ -103,9 +102,9 @@ CompilerIntegerParam * ServerResourcePoolObjectTemplate::getCompilerIntegerParam
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_mapSeed;
|
||||
}
|
||||
@@ -117,9 +116,9 @@ CompilerIntegerParam * ServerResourcePoolObjectTemplate::getCompilerIntegerParam
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_amountRemaining;
|
||||
}
|
||||
@@ -127,7 +126,7 @@ CompilerIntegerParam * ServerResourcePoolObjectTemplate::getCompilerIntegerParam
|
||||
}
|
||||
else
|
||||
return ServerUniverseObjectTemplate::getCompilerIntegerParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
} //ServerResourcePoolObjectTemplate::getCompilerIntegerParam
|
||||
|
||||
FloatParam * ServerResourcePoolObjectTemplate::getFloatParam(const char *name, bool deepCheck, int index)
|
||||
@@ -225,12 +224,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
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)
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
if (m_baseData != NULL)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
Executable → Regular
Executable → Regular
+9
-10
@@ -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 ServerResourceTypeObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerResourceTypeObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerResourceTypeObjectTemplate * base = dynamic_cast<const ServerResourceTypeObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerResourceTypeObjectTemplate::getHighestTemplateVersion
|
||||
@@ -118,9 +117,9 @@ StringParam * ServerResourceTypeObjectTemplate::getStringParam(const char *name,
|
||||
{
|
||||
if (deepCheck && !isParamLoaded(name, false, 0))
|
||||
{
|
||||
if (getBaseTemplate() != nullptr)
|
||||
if (getBaseTemplate() != NULL)
|
||||
return getBaseTemplate()->getStringParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return &m_resourceName;
|
||||
}
|
||||
@@ -128,7 +127,7 @@ StringParam * ServerResourceTypeObjectTemplate::getStringParam(const char *name,
|
||||
}
|
||||
else
|
||||
return ServerUniverseObjectTemplate::getStringParam(name, deepCheck, index);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
} //ServerResourceTypeObjectTemplate::getStringParam
|
||||
|
||||
StringIdParam * ServerResourceTypeObjectTemplate::getStringIdParam(const char *name, bool deepCheck, int index)
|
||||
@@ -211,12 +210,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
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)
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
if (m_baseData != NULL)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
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 ServerShipObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerShipObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerShipObjectTemplate * base = dynamic_cast<const ServerShipObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerShipObjectTemplate::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 ServerStaticObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerStaticObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerStaticObjectTemplate * base = dynamic_cast<const ServerStaticObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerStaticObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+20
-20
@@ -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 @@
|
||||
ServerTangibleObjectTemplate::ServerTangibleObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerObjectTemplate(filename)
|
||||
, m_triggerVolumesLoaded(false)
|
||||
, m_triggerVolumesAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_triggerVolumesLoaded(false)
|
||||
,m_triggerVolumesAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerTangibleObjectTemplate::ServerTangibleObjectTemplate
|
||||
|
||||
@@ -39,7 +38,7 @@ ServerTangibleObjectTemplate::ServerTangibleObjectTemplate(const std::string & f
|
||||
*/
|
||||
ServerTangibleObjectTemplate::~ServerTangibleObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
{
|
||||
std::vector<TriggerVolumeParam *>::iterator iter;
|
||||
for (iter = m_triggerVolumes.begin(); iter != m_triggerVolumes.end(); ++iter)
|
||||
@@ -49,7 +48,7 @@ ServerTangibleObjectTemplate::~ServerTangibleObjectTemplate()
|
||||
}
|
||||
m_triggerVolumes.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerTangibleObjectTemplate::~ServerTangibleObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -97,10 +96,10 @@ Tag ServerTangibleObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerTangibleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerTangibleObjectTemplate * base = dynamic_cast<const ServerTangibleObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerTangibleObjectTemplate::getHighestTemplateVersion
|
||||
@@ -303,6 +302,7 @@ bool ServerTangibleObjectTemplate::isAppend(const char *name) const
|
||||
return ServerObjectTemplate::isAppend(name);
|
||||
} // ServerTangibleObjectTemplate::isAppend
|
||||
|
||||
|
||||
int ServerTangibleObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "triggerVolumes") == 0)
|
||||
@@ -321,8 +321,8 @@ int ServerTangibleObjectTemplate::getListLength(const char *name) const
|
||||
*/
|
||||
void ServerTangibleObjectTemplate::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() != ServerTangibleObjectTemplate_tag)
|
||||
{
|
||||
@@ -332,7 +332,7 @@ void ServerTangibleObjectTemplate::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();
|
||||
@@ -352,7 +352,7 @@ void ServerTangibleObjectTemplate::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()));
|
||||
@@ -417,18 +417,18 @@ void ServerTangibleObjectTemplate::load(Iff &file)
|
||||
*/
|
||||
void ServerTangibleObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(ServerTangibleObjectTemplate_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, 4));
|
||||
file.insertForm(TAG(0,0,0,4));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -445,7 +445,7 @@ void ServerTangibleObjectTemplate::save(Iff &file)
|
||||
count = m_triggerVolumes.size();
|
||||
file.insertChunkData(&count, sizeof(count));
|
||||
{for (int i = 0; i < count; ++i)
|
||||
m_triggerVolumes[i]->saveToIff(file); }
|
||||
m_triggerVolumes[i]->saveToIff(file);}
|
||||
file.exitChunk();
|
||||
++paramCount;
|
||||
// save combatSkeleton
|
||||
@@ -502,4 +502,4 @@ void ServerTangibleObjectTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // ServerTangibleObjectTemplate::save
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
+9
-3
@@ -77,7 +77,10 @@ public:
|
||||
C_inflightTutorial = 0x00800000,
|
||||
C_spaceCombatMusic = 0x01000000, // Set programmatically by the AI system. Do not set this in the template.
|
||||
C_encounterLocked = 0x02000000,
|
||||
Conditions_Last = C_encounterLocked,
|
||||
C_spawnedCreature = 0x04000000,
|
||||
C_holidayInteresting = 0x08000000,
|
||||
C_locked = 0x10000000,
|
||||
Conditions_Last = C_locked,
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -101,8 +104,11 @@ protected:
|
||||
virtual void save(Iff &file);
|
||||
|
||||
private:
|
||||
// these MUST be reflected in clientGame/TangibleObject.h
|
||||
// these MUST be reflected in base_class.java
|
||||
// these MUST be reflected in:
|
||||
// //depot/swg/current/dsrc/sku.0/sys.server/compiled/game/object/tangible_object_template.tdf
|
||||
// //depot/swg/current/dsrc/sku.0/sys.server/compiled/game/script/base_class.java
|
||||
// //depot/swg/current/src/engine/client/library/clientGame/src/shared/object/TangibleObject.h
|
||||
// //depot/swg/current/src/engine/server/library/serverGame/src/shared/object/TangibleObject.h
|
||||
stdvector<TriggerVolumeParam *>::fwd m_triggerVolumes; // trigger volume(s) attached to the object
|
||||
bool m_triggerVolumesLoaded;
|
||||
bool m_triggerVolumesAppend;
|
||||
|
||||
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 ServerTokenObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerTokenObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerTokenObjectTemplate * base = dynamic_cast<const ServerTokenObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerTokenObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+293
-291
File diff suppressed because it is too large
Load Diff
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 ServerUniverseObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerUniverseObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerUniverseObjectTemplate * base = dynamic_cast<const ServerUniverseObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerUniverseObjectTemplate::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 ServerVehicleObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerVehicleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerVehicleObjectTemplate * base = dynamic_cast<const ServerVehicleObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerVehicleObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+6
-7
@@ -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 ServerWaypointObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerWaypointObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerWaypointObjectTemplate * base = dynamic_cast<const ServerWaypointObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerWaypointObjectTemplate::getHighestTemplateVersion
|
||||
@@ -195,12 +194,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
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)
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != nullptr)
|
||||
if (m_baseData != NULL)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
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 ServerWeaponObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerWeaponObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerWeaponObjectTemplate * base = dynamic_cast<const ServerWeaponObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerWeaponObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
+3
-1
@@ -72,7 +72,9 @@ public:
|
||||
WT_1handLightsaber,
|
||||
WT_2handLightsaber,
|
||||
WT_polearmLightsaber,
|
||||
WeaponType_Last = WT_polearmLightsaber,
|
||||
WT_groundTargetting,
|
||||
WT_directionTargetting,
|
||||
WeaponType_Last = WT_directionTargetting,
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
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 ServerXpManagerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag ServerXpManagerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const ServerXpManagerObjectTemplate * base = dynamic_cast<const ServerXpManagerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // ServerXpManagerObjectTemplate::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 SharedBattlefieldMarkerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedBattlefieldMarkerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedBattlefieldMarkerObjectTemplate::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 SharedBuildingObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedBuildingObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedBuildingObjectTemplate * base = dynamic_cast<const SharedBuildingObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedBuildingObjectTemplate::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 SharedCellObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedCellObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedCellObjectTemplate * base = dynamic_cast<const SharedCellObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedCellObjectTemplate::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 SharedConstructionContractObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedConstructionContractObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedConstructionContractObjectTemplate * base = dynamic_cast<const SharedConstructionContractObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedConstructionContractObjectTemplate::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 SharedCreatureObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedCreatureObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedCreatureObjectTemplate * base = dynamic_cast<const SharedCreatureObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedCreatureObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Executable → Regular
+33
-29
@@ -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 @@
|
||||
SharedDraftSchematicObjectTemplate::SharedDraftSchematicObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: SharedIntangibleObjectTemplate(filename)
|
||||
, m_slotsLoaded(false)
|
||||
, m_slotsAppend(false)
|
||||
, m_attributesLoaded(false)
|
||||
, m_attributesAppend(false)
|
||||
, m_templateVersion(0)
|
||||
, m_versionOk(false)
|
||||
//@END TFD INIT
|
||||
,m_slotsLoaded(false)
|
||||
,m_slotsAppend(false)
|
||||
,m_attributesLoaded(false)
|
||||
,m_attributesAppend(false)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // SharedDraftSchematicObjectTemplate::SharedDraftSchematicObjectTemplate
|
||||
|
||||
@@ -41,7 +40,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)
|
||||
@@ -60,7 +59,7 @@ SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate()
|
||||
}
|
||||
m_attributes.clear();
|
||||
}
|
||||
//@END TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -108,10 +107,10 @@ Tag SharedDraftSchematicObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedDraftSchematicObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedDraftSchematicObjectTemplate * base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedDraftSchematicObjectTemplate::getHighestTemplateVersion
|
||||
@@ -252,6 +251,7 @@ bool SharedDraftSchematicObjectTemplate::isAppend(const char *name) const
|
||||
return SharedIntangibleObjectTemplate::isAppend(name);
|
||||
} // SharedDraftSchematicObjectTemplate::isAppend
|
||||
|
||||
|
||||
int SharedDraftSchematicObjectTemplate::getListLength(const char *name) const
|
||||
{
|
||||
if (strcmp(name, "slots") == 0)
|
||||
@@ -274,8 +274,8 @@ int SharedDraftSchematicObjectTemplate::getListLength(const char *name) const
|
||||
*/
|
||||
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)
|
||||
{
|
||||
@@ -285,7 +285,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();
|
||||
@@ -305,7 +305,7 @@ 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()));
|
||||
@@ -377,18 +377,18 @@ void SharedDraftSchematicObjectTemplate::load(Iff &file)
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(SharedDraftSchematicObjectTemplate_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, 3));
|
||||
file.insertForm(TAG(0,0,0,3));
|
||||
file.allowNonlinearFunctions();
|
||||
|
||||
int paramCount = 0;
|
||||
@@ -405,7 +405,7 @@ void SharedDraftSchematicObjectTemplate::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_attributesLoaded)
|
||||
@@ -420,7 +420,7 @@ void SharedDraftSchematicObjectTemplate::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;
|
||||
// save craftedSharedTemplate
|
||||
@@ -441,6 +441,7 @@ void SharedDraftSchematicObjectTemplate::save(Iff &file)
|
||||
file.exitForm();
|
||||
} // SharedDraftSchematicObjectTemplate::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class SharedDraftSchematicObjectTemplate::_IngredientSlot
|
||||
|
||||
@@ -586,6 +587,7 @@ bool SharedDraftSchematicObjectTemplate::_IngredientSlot::isAppend(const char *n
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::isAppend
|
||||
|
||||
|
||||
int SharedDraftSchematicObjectTemplate::_IngredientSlot::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -599,8 +601,8 @@ int SharedDraftSchematicObjectTemplate::_IngredientSlot::getListLength(const cha
|
||||
*/
|
||||
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();
|
||||
|
||||
@@ -630,7 +632,7 @@ void SharedDraftSchematicObjectTemplate::_IngredientSlot::load(Iff &file)
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_IngredientSlot_tag);
|
||||
|
||||
@@ -659,6 +661,7 @@ void SharedDraftSchematicObjectTemplate::_IngredientSlot::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // SharedDraftSchematicObjectTemplate::_IngredientSlot::save
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// class SharedDraftSchematicObjectTemplate::_SchematicAttribute
|
||||
|
||||
@@ -818,6 +821,7 @@ bool SharedDraftSchematicObjectTemplate::_SchematicAttribute::isAppend(const cha
|
||||
return TpfTemplate::isAppend(name);
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::isAppend
|
||||
|
||||
|
||||
int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getListLength(const char *name) const
|
||||
{
|
||||
return TpfTemplate::getListLength(name);
|
||||
@@ -831,8 +835,8 @@ int SharedDraftSchematicObjectTemplate::_SchematicAttribute::getListLength(const
|
||||
*/
|
||||
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();
|
||||
|
||||
@@ -864,7 +868,7 @@ void SharedDraftSchematicObjectTemplate::_SchematicAttribute::load(Iff &file)
|
||||
*/
|
||||
void SharedDraftSchematicObjectTemplate::_SchematicAttribute::save(Iff &file)
|
||||
{
|
||||
int count;
|
||||
int count;
|
||||
|
||||
file.insertForm(_SchematicAttribute_tag);
|
||||
|
||||
@@ -899,4 +903,4 @@ void SharedDraftSchematicObjectTemplate::_SchematicAttribute::save(Iff &file)
|
||||
UNREF(count);
|
||||
} // SharedDraftSchematicObjectTemplate::_SchematicAttribute::save
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
|
||||
Executable → Regular
-1
@@ -53,7 +53,6 @@ public:
|
||||
|
||||
enum DamageType
|
||||
{
|
||||
DT_none = 0x000000,
|
||||
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 SharedFactoryObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedFactoryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedFactoryObjectTemplate * base = dynamic_cast<const SharedFactoryObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedFactoryObjectTemplate::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 SharedGroupObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedGroupObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedGroupObjectTemplate * base = dynamic_cast<const SharedGroupObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedGroupObjectTemplate::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 SharedGuildObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedGuildObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedGuildObjectTemplate * base = dynamic_cast<const SharedGuildObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedGuildObjectTemplate::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 SharedInstallationObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedInstallationObjectTemplate * base = dynamic_cast<const SharedInstallationObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedInstallationObjectTemplate::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 SharedIntangibleObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedIntangibleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == nullptr)
|
||||
if (m_baseData == NULL)
|
||||
return m_templateVersion;
|
||||
const SharedIntangibleObjectTemplate * base = dynamic_cast<const SharedIntangibleObjectTemplate *>(m_baseData);
|
||||
if (base == nullptr)
|
||||
if (base == NULL)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedIntangibleObjectTemplate::getHighestTemplateVersion
|
||||
|
||||
Executable → Regular
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user