Skip to content

Commit

Permalink
Indicate sex in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cybiosphere committed Oct 11, 2024
1 parent b16e1fa commit f2967a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions WpEntity/inc/CBasicEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ class DLL_CYBIOCORE_API CBasicEntity
ReproType_e getTypeOfReproduction();
void setTypeOfReproduction(ReproType_e newType);
SexType_e getSex();
string getSexString();
CGenome* getGenome();
double getNoise();
void setNoise(int rate);
Expand Down
3 changes: 2 additions & 1 deletion WpEntity/src/CAnimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3169,7 +3169,8 @@ void CAnimal::logDeathCause(std::string deathCauseStr)
if (m_pBiotop != NULL)
{
CYBIOCORE_LOG_TIME(m_pBiotop->getBiotopTime());
CYBIOCORE_LOG("ANIMAL - Death : specie %s name %s age %ddays is dead ", getSpecieName().c_str(), getLabel().c_str(), getAge());
CYBIOCORE_LOG("ANIMAL - Death : specie %s name %s age %ddays sex %s is dead ",
getSpecieName().c_str(), getLabel().c_str(), getAge(), getSexString());
CYBIOCORE_LOG(deathCauseStr.c_str());
}
}
Expand Down
15 changes: 15 additions & 0 deletions WpEntity/src/CBasicEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,21 @@ SexType_e CBasicEntity::getSex()
return (m_Sex);
}

string CBasicEntity::getSexString()
{
switch (m_Sex)
{
case SEX_NONE:
return "None";
case SEX_MALE:
return "Male";
case SEX_FEMALE:
return "Female";
default:
return "Unset";
}
}

CBiotop* CBasicEntity::getBiotop()
{
return (m_pBiotop);
Expand Down

0 comments on commit f2967a7

Please sign in to comment.