mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 19:29:47 +02:00
- validation now works on techtree's with linked factions
This commit is contained in:
@@ -20,10 +20,12 @@
|
|||||||
//#include "util.h"
|
//#include "util.h"
|
||||||
#include "platform_common.h"
|
#include "platform_common.h"
|
||||||
#include "conversion.h"
|
#include "conversion.h"
|
||||||
|
#include "platform_util.h"
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
using namespace Shared::Util;
|
using namespace Shared::Util;
|
||||||
using namespace Shared::PlatformCommon;
|
using namespace Shared::PlatformCommon;
|
||||||
|
using namespace Shared::Platform;
|
||||||
using Shared::Xml::XmlNode;
|
using Shared::Xml::XmlNode;
|
||||||
|
|
||||||
namespace Glest{ namespace Game{
|
namespace Glest{ namespace Game{
|
||||||
@@ -151,18 +153,55 @@ public:
|
|||||||
const string &getTech() const {return tech;}
|
const string &getTech() const {return tech;}
|
||||||
const string &getScenario() const {return scenario;}
|
const string &getScenario() const {return scenario;}
|
||||||
const string &getScenarioDir() const {return scenarioDir;}
|
const string &getScenarioDir() const {return scenarioDir;}
|
||||||
const string &getFactionTypeName(int factionIndex) const {return factionTypeNames[factionIndex];}
|
const string &getFactionTypeName(int factionIndex) const {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
return factionTypeNames[factionIndex];
|
||||||
|
}
|
||||||
string getNetworkPlayerName(int factionIndex) const {
|
string getNetworkPlayerName(int factionIndex) const {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
string result = networkPlayerNames[factionIndex];
|
string result = networkPlayerNames[factionIndex];
|
||||||
if(networkPlayerStatuses[factionIndex] == npst_Disconnected) {
|
if(networkPlayerStatuses[factionIndex] == npst_Disconnected) {
|
||||||
result = playerDisconnectedText + result;
|
result = playerDisconnectedText + result;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
const int getNetworkPlayerStatuses(int factionIndex) const { return networkPlayerStatuses[factionIndex];}
|
const int getNetworkPlayerStatuses(int factionIndex) const {
|
||||||
const string getNetworkPlayerLanguages(int factionIndex) const { return networkPlayerLanguages[factionIndex];}
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
const int getNetworkPlayerGameStatus(int factionIndex) const { return networkPlayerGameStatus[factionIndex];}
|
return networkPlayerStatuses[factionIndex];
|
||||||
|
}
|
||||||
|
const string getNetworkPlayerLanguages(int factionIndex) const {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return networkPlayerLanguages[factionIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
const int getNetworkPlayerGameStatus(int factionIndex) const {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return networkPlayerGameStatus[factionIndex];
|
||||||
|
}
|
||||||
|
|
||||||
const vector<string> getUniqueNetworkPlayerLanguages() const {
|
const vector<string> getUniqueNetworkPlayerLanguages() const {
|
||||||
vector<string> languageList;
|
vector<string> languageList;
|
||||||
@@ -189,8 +228,24 @@ public:
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
ControlType getFactionControl(int factionIndex) const {return factionControls[factionIndex];}
|
ControlType getFactionControl(int factionIndex) const {
|
||||||
int getResourceMultiplierIndex(int factionIndex) const {return resourceMultiplierIndex[factionIndex];}
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return factionControls[factionIndex];
|
||||||
|
}
|
||||||
|
int getResourceMultiplierIndex(int factionIndex) const {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resourceMultiplierIndex[factionIndex];
|
||||||
|
}
|
||||||
|
|
||||||
bool isNetworkGame() const {
|
bool isNetworkGame() const {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@@ -205,8 +260,25 @@ public:
|
|||||||
}
|
}
|
||||||
int getThisFactionIndex() const {return thisFactionIndex;}
|
int getThisFactionIndex() const {return thisFactionIndex;}
|
||||||
int getFactionCount() const {return factionCount;}
|
int getFactionCount() const {return factionCount;}
|
||||||
int getTeam(int factionIndex) const {return teams[factionIndex];}
|
int getTeam(int factionIndex) const {
|
||||||
int getStartLocationIndex(int factionIndex) const {return startLocationIndex[factionIndex];}
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return teams[factionIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
int getStartLocationIndex(int factionIndex) const {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return startLocationIndex[factionIndex];
|
||||||
|
}
|
||||||
int getMapFilterIndex() const {return mapFilterIndex;}
|
int getMapFilterIndex() const {return mapFilterIndex;}
|
||||||
|
|
||||||
bool getDefaultUnits() const {return defaultUnits;}
|
bool getDefaultUnits() const {return defaultUnits;}
|
||||||
@@ -235,20 +307,94 @@ public:
|
|||||||
void setScenario(const string& scenario) {this->scenario= scenario;}
|
void setScenario(const string& scenario) {this->scenario= scenario;}
|
||||||
void setScenarioDir(const string& scenarioDir) {this->scenarioDir= scenarioDir;}
|
void setScenarioDir(const string& scenarioDir) {this->scenarioDir= scenarioDir;}
|
||||||
|
|
||||||
void setFactionTypeName(int factionIndex, const string& factionTypeName) {this->factionTypeNames[factionIndex]= factionTypeName;}
|
void setFactionTypeName(int factionIndex, const string& factionTypeName) {
|
||||||
void setNetworkPlayerName(int factionIndex,const string& playername) {this->networkPlayerNames[factionIndex]= playername;}
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
void setNetworkPlayerStatuses(int factionIndex,int status) {this->networkPlayerStatuses[factionIndex]= status;}
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
void setNetworkPlayerGameStatus(int factionIndex,int status) {this->networkPlayerGameStatus[factionIndex]= status;}
|
this->factionTypeNames[factionIndex]= factionTypeName;
|
||||||
void setNetworkPlayerLanguages(int factionIndex, string language) {this->networkPlayerLanguages[factionIndex]=language;}
|
}
|
||||||
|
void setNetworkPlayerName(int factionIndex,const string& playername) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
void setFactionControl(int factionIndex, ControlType controller) {this->factionControls[factionIndex]= controller;}
|
this->networkPlayerNames[factionIndex]= playername;
|
||||||
void setResourceMultiplierIndex(int factionIndex, int multiplierIndex) {this->resourceMultiplierIndex[factionIndex]= multiplierIndex;}
|
}
|
||||||
|
void setNetworkPlayerStatuses(int factionIndex,int status) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
void setThisFactionIndex(int thisFactionIndex) {this->thisFactionIndex= thisFactionIndex;}
|
this->networkPlayerStatuses[factionIndex]= status;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setNetworkPlayerGameStatus(int factionIndex,int status) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->networkPlayerGameStatus[factionIndex]= status;
|
||||||
|
}
|
||||||
|
void setNetworkPlayerLanguages(int factionIndex, string language) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->networkPlayerLanguages[factionIndex]=language;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setFactionControl(int factionIndex, ControlType controller) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->factionControls[factionIndex]= controller;
|
||||||
|
}
|
||||||
|
void setResourceMultiplierIndex(int factionIndex, int multiplierIndex) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->resourceMultiplierIndex[factionIndex]= multiplierIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setThisFactionIndex(int thisFactionIndex) {
|
||||||
|
this->thisFactionIndex= thisFactionIndex;
|
||||||
|
}
|
||||||
void setFactionCount(int factionCount) {this->factionCount= factionCount;}
|
void setFactionCount(int factionCount) {this->factionCount= factionCount;}
|
||||||
void setTeam(int factionIndex, int team) {this->teams[factionIndex]= team;}
|
void setTeam(int factionIndex, int team) {
|
||||||
void setStartLocationIndex(int factionIndex, int startLocationIndex) {this->startLocationIndex[factionIndex]= startLocationIndex;}
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->teams[factionIndex]= team;
|
||||||
|
}
|
||||||
|
void setStartLocationIndex(int factionIndex, int startLocationIndex) {
|
||||||
|
if(factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) {
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"In [%s] Invalid factionIndex = %d\n",__FUNCTION__,factionIndex);
|
||||||
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->startLocationIndex[factionIndex]= startLocationIndex;
|
||||||
|
}
|
||||||
void setMapFilterIndex(int mapFilterIndex) {this->mapFilterIndex=mapFilterIndex;}
|
void setMapFilterIndex(int mapFilterIndex) {this->mapFilterIndex=mapFilterIndex;}
|
||||||
|
|
||||||
void setDefaultUnits(bool defaultUnits) {this->defaultUnits= defaultUnits;}
|
void setDefaultUnits(bool defaultUnits) {this->defaultUnits= defaultUnits;}
|
||||||
|
@@ -1550,7 +1550,7 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
|
|||||||
printf("foundText = %d\n",foundText);
|
printf("foundText = %d\n",foundText);
|
||||||
if(foundText == false) {
|
if(foundText == false) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"Error finding text [%s] in file [%s]",searchText.c_str(),parentFile.c_str());
|
sprintf(szBuf,"Line ref = %d, Error finding text [%s] in file [%s]",__LINE__,searchText.c_str(),parentFile.c_str());
|
||||||
throw megaglest_runtime_error(szBuf);
|
throw megaglest_runtime_error(szBuf);
|
||||||
}
|
}
|
||||||
mapUniqueParentList[parentFile]++;
|
mapUniqueParentList[parentFile]++;
|
||||||
@@ -1596,7 +1596,7 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
|
|||||||
if(foundText == false) {
|
if(foundText == false) {
|
||||||
|
|
||||||
char szBuf[8096]="";
|
char szBuf[8096]="";
|
||||||
sprintf(szBuf,"Error finding text\n[%s]\nin file\n[%s]\nnew Common File [%s]\n",searchText.c_str(),parentFile.c_str(),newCommonFileName.c_str());
|
sprintf(szBuf,"Line ref = %d, Error finding text\n[%s]\nin file\n[%s]\nnew Common File [%s]\n",__LINE__,searchText.c_str(),parentFile.c_str(),newCommonFileName.c_str());
|
||||||
printf("\n\n=================================================\n%s",szBuf);
|
printf("\n\n=================================================\n%s",szBuf);
|
||||||
|
|
||||||
throw megaglest_runtime_error(szBuf);
|
throw megaglest_runtime_error(szBuf);
|
||||||
@@ -1659,6 +1659,9 @@ void runTechValidationForPath(string techPath, string techName,
|
|||||||
//vector<string> pathList = config.getPathListForType(ptTechs,"");
|
//vector<string> pathList = config.getPathListForType(ptTechs,"");
|
||||||
vector<string> pathList;
|
vector<string> pathList;
|
||||||
pathList.push_back(techPath);
|
pathList.push_back(techPath);
|
||||||
|
Config &config = Config::getInstance();
|
||||||
|
vector<string> otherTechPaths = config.getPathListForType(ptTechs,"");
|
||||||
|
pathList.insert(pathList.end(), otherTechPaths.begin(), otherTechPaths.end());
|
||||||
world.loadTech(pathList, techName, factions, &checksum, loadedFileList);
|
world.loadTech(pathList, techName, factions, &checksum, loadedFileList);
|
||||||
|
|
||||||
// Fixup paths with ..
|
// Fixup paths with ..
|
||||||
@@ -1878,7 +1881,7 @@ void runTechValidationForPath(string techPath, string techName,
|
|||||||
printf("\nWarning, duplicate files were detected - START:\n=====================\n");
|
printf("\nWarning, duplicate files were detected - START:\n=====================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("----- START duplicate files for CRC [%d] count [%lu] first file is [%s]\n",iterMap->first,fileList.size(),fileList[0].c_str());
|
printf("----- START duplicate files for CRC [%u] count [%lu] first file is [%s]\n",iterMap->first,fileList.size(),fileList[0].c_str());
|
||||||
|
|
||||||
map<string,int> parentList;
|
map<string,int> parentList;
|
||||||
for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
|
for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
|
||||||
@@ -2048,7 +2051,7 @@ void runTechValidationForPath(string techPath, string techName,
|
|||||||
//printf("Error finding text [%s] in file [%s]",searchText.c_str(),parentFile.c_str());
|
//printf("Error finding text [%s] in file [%s]",searchText.c_str(),parentFile.c_str());
|
||||||
|
|
||||||
char szBuf[8096]="";
|
char szBuf[8096]="";
|
||||||
sprintf(szBuf,"Error finding text\n[%s]\nin file\n[%s]\nnew Common File [%s]\n",searchText.c_str(),parentFile.c_str(),newCommonFileName.c_str());
|
sprintf(szBuf,"Line ref = %d, Error finding text\n[%s]\nin file\n[%s]\nnew Common File [%s]\n",__LINE__,searchText.c_str(),parentFile.c_str(),newCommonFileName.c_str());
|
||||||
printf("\n\n=================================================\n%s",szBuf);
|
printf("\n\n=================================================\n%s",szBuf);
|
||||||
|
|
||||||
throw megaglest_runtime_error(szBuf);
|
throw megaglest_runtime_error(szBuf);
|
||||||
@@ -2115,11 +2118,15 @@ void runTechValidationForPath(string techPath, string techName,
|
|||||||
if(foundText == false) {
|
if(foundText == false) {
|
||||||
//printf("Error finding text [%s] in file [%s]",searchText.c_str(),parentFile.c_str());
|
//printf("Error finding text [%s] in file [%s]",searchText.c_str(),parentFile.c_str());
|
||||||
|
|
||||||
char szBuf[8096]="";
|
// Check if the sound file already references commandata
|
||||||
sprintf(szBuf,"Error finding text\n[%s]\nin file\n[%s]\nnew Common File [%s]\n",searchText.c_str(),parentFile.c_str(),newCommonFileName.c_str());
|
foundText = searchAndReplaceTextInFile(parentFile, newCommonFileName, newCommonFileName, true);
|
||||||
printf("\n\n=================================================\n%s",szBuf);
|
if(foundText == false) {
|
||||||
|
char szBuf[8096]="";
|
||||||
|
sprintf(szBuf,"Line ref = %d, Error finding text\n[%s]\nin file\n[%s]\nnew Common File [%s]\n",__LINE__,searchText.c_str(),parentFile.c_str(),newCommonFileName.c_str());
|
||||||
|
printf("\n\n=================================================\n%s",szBuf);
|
||||||
|
|
||||||
throw megaglest_runtime_error(szBuf);
|
throw megaglest_runtime_error(szBuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,7 @@ namespace Glest{ namespace Game{
|
|||||||
FactionType::FactionType() {
|
FactionType::FactionType() {
|
||||||
music = NULL;
|
music = NULL;
|
||||||
personalityType = fpt_Normal;
|
personalityType = fpt_Normal;
|
||||||
|
isLinked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//load a faction, given a directory
|
//load a faction, given a directory
|
||||||
@@ -75,6 +76,9 @@ void FactionType::load(const string &factionName, const TechTree *techTree, Chec
|
|||||||
const XmlNode *rootNode= xmlTree.getRootNode();
|
const XmlNode *rootNode= xmlTree.getRootNode();
|
||||||
|
|
||||||
if(rootNode->getName()=="link") {
|
if(rootNode->getName()=="link") {
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"Faction [%s] is a linked faction\n",name.c_str());
|
||||||
|
|
||||||
|
isLinked = true;
|
||||||
const XmlNode *techTreeNode= rootNode->getChild("techtree");
|
const XmlNode *techTreeNode= rootNode->getChild("techtree");
|
||||||
const string linkedTechTreeName=techTreeNode->getAttribute("name")->getRestrictedValue();
|
const string linkedTechTreeName=techTreeNode->getAttribute("name")->getRestrictedValue();
|
||||||
// const XmlNode *factionLinkNode= rootNode->getChild("faction");
|
// const XmlNode *factionLinkNode= rootNode->getChild("faction");
|
||||||
@@ -83,6 +87,8 @@ void FactionType::load(const string &factionName, const TechTree *techTree, Chec
|
|||||||
techTreePath=linkedTechTreePath;
|
techTreePath=linkedTechTreePath;
|
||||||
endPathWithSlash(techTreePath);
|
endPathWithSlash(techTreePath);
|
||||||
techTreeName=linkedTechTreeName;
|
techTreeName=linkedTechTreeName;
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"techTreePath [%s] techTreeName [%s]\n",techTreePath.c_str(),techTreeName.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// stop looking for new path, no more links ...
|
// stop looking for new path, no more links ...
|
||||||
@@ -106,6 +112,8 @@ void FactionType::load(const string &factionName, const TechTree *techTree, Chec
|
|||||||
Logger::getInstance().add(szBuf, true);
|
Logger::getInstance().add(szBuf, true);
|
||||||
|
|
||||||
if(personalityType == fpt_Normal) {
|
if(personalityType == fpt_Normal) {
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"Loading faction [%s] currentPath [%s]\n",path.c_str(),currentPath.c_str());
|
||||||
|
|
||||||
checksum->addFile(path);
|
checksum->addFile(path);
|
||||||
techtreeChecksum->addFile(path);
|
techtreeChecksum->addFile(path);
|
||||||
|
|
||||||
@@ -173,6 +181,9 @@ void FactionType::load(const string &factionName, const TechTree *techTree, Chec
|
|||||||
}
|
}
|
||||||
|
|
||||||
string tmppath= currentPath + factionName +".xml";
|
string tmppath= currentPath + factionName +".xml";
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"Loading faction xml [%s]\n",tmppath.c_str());
|
||||||
|
|
||||||
std::map<string,string> mapExtraTagReplacementValues;
|
std::map<string,string> mapExtraTagReplacementValues;
|
||||||
mapExtraTagReplacementValues["$COMMONDATAPATH"] = techTreePath + "/commondata/";
|
mapExtraTagReplacementValues["$COMMONDATAPATH"] = techTreePath + "/commondata/";
|
||||||
//printf("current $COMMONDATAPATH = %s\n",mapExtraTagReplacementValues["$COMMONDATAPATH"].c_str());
|
//printf("current $COMMONDATAPATH = %s\n",mapExtraTagReplacementValues["$COMMONDATAPATH"].c_str());
|
||||||
|
@@ -94,6 +94,8 @@ private:
|
|||||||
std::vector<const UpgradeType*> vctAIBehaviorUpgrades;
|
std::vector<const UpgradeType*> vctAIBehaviorUpgrades;
|
||||||
std::map<AIBehaviorStaticValueCategory, int > mapAIBehaviorStaticOverrideValues;
|
std::map<AIBehaviorStaticValueCategory, int > mapAIBehaviorStaticOverrideValues;
|
||||||
|
|
||||||
|
bool isLinked;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//init
|
//init
|
||||||
FactionType();
|
FactionType();
|
||||||
@@ -106,6 +108,7 @@ public:
|
|||||||
int getAIBehaviorStaticOverideValue(AIBehaviorStaticValueCategory type) const;
|
int getAIBehaviorStaticOverideValue(AIBehaviorStaticValueCategory type) const;
|
||||||
|
|
||||||
//get
|
//get
|
||||||
|
bool getIsLinked() const { return isLinked; }
|
||||||
int getUnitTypeCount() const {return unitTypes.size();}
|
int getUnitTypeCount() const {return unitTypes.size();}
|
||||||
int getUpgradeTypeCount() const {return upgradeTypes.size();}
|
int getUpgradeTypeCount() const {return upgradeTypes.size();}
|
||||||
string getName() const {return name;}
|
string getName() const {return name;}
|
||||||
|
Reference in New Issue
Block a user