1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Minor changes (serialization and related)

This commit is contained in:
Michał W. Urbańczyk
2008-12-31 09:33:46 +00:00
parent 4a8ae4ed9a
commit f853074d20
8 changed files with 143 additions and 93 deletions

View File

@ -154,7 +154,6 @@ CGObjectInstance::CGObjectInstance(): animPhaseShift(rand()%0xff)
//state = new CLuaObjectScript();
ID = subID = id = -1;
defInfo = NULL;
state = NULL;
info = NULL;
tempOwner = 254;
blockVisit = false;
@ -166,34 +165,34 @@ CGObjectInstance::~CGObjectInstance()
// delete state;
//state=NULL;
}
CGObjectInstance::CGObjectInstance(const CGObjectInstance & right)
{
pos = right.pos;
ID = right.ID;
subID = right.subID;
id = right.id;
defInfo = right.defInfo;
info = right.info;
blockVisit = right.blockVisit;
//state = new CLuaObjectScript(right.state->);
//*state = *right.state;
//state = right.state;
tempOwner = right.tempOwner;
}
CGObjectInstance& CGObjectInstance::operator=(const CGObjectInstance & right)
{
pos = right.pos;
ID = right.ID;
subID = right.subID;
id = right.id;
defInfo = right.defInfo;
info = right.info;
blockVisit = right.blockVisit;
//state = new CLuaObjectScript();
//*state = *right.state;
tempOwner = right.tempOwner;
return *this;
}
//CGObjectInstance::CGObjectInstance(const CGObjectInstance & right)
//{
// pos = right.pos;
// ID = right.ID;
// subID = right.subID;
// id = right.id;
// defInfo = right.defInfo;
// info = right.info;
// blockVisit = right.blockVisit;
// //state = new CLuaObjectScript(right.state->);
// //*state = *right.state;
// //state = right.state;
// tempOwner = right.tempOwner;
//}
//CGObjectInstance& CGObjectInstance::operator=(const CGObjectInstance & right)
//{
// pos = right.pos;
// ID = right.ID;
// subID = right.subID;
// id = right.id;
// defInfo = right.defInfo;
// info = right.info;
// blockVisit = right.blockVisit;
// //state = new CLuaObjectScript();
// //*state = *right.state;
// tempOwner = right.tempOwner;
// return *this;
//}
const std::string & CGObjectInstance::getHoverText() const
{
@ -380,7 +379,7 @@ int CGHeroInstance::getSightDistance() const //returns sight distance of this he
return 6 + getSecSkillLevel(3); //default + scouting
}
int CGHeroInstance::manaLimit() const
si32 CGHeroInstance::manaLimit() const
{
double modifier = 1.0;
switch(getSecSkillLevel(24)) //intelligence level
@ -418,7 +417,7 @@ int CGHeroInstance::getPrimSkillLevel(int id) const
{
return primSkills[id];
}
int CGHeroInstance::getSecSkillLevel(const int & ID) const
ui8 CGHeroInstance::getSecSkillLevel(const int & ID) const
{
for(size_t i=0; i < secSkills.size(); ++i)
if(secSkills[i].first==ID)