// m_paiNoTradeTech[eIndex] = n
// n<0 means tech can never be traded
// n==0 means tech can be traded now
// n>0 means tech can be traded in n turns
bool CvTeam::isNoTradeTech(TechTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
FAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");
// return m_pabNoTradeTech[eIndex];
return !(m_paiNoTradeTech[eIndex] == 0);
}
// note this is already called when a player researches a tech or receives it by trade
// so it should be easy to modify a little
void CvTeam::setNoTradeTech(TechTypes eIndex, int iNewValue /*bool bNewValue*/)
{
FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
FAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");
// m_pabNoTradeTech[eIndex] = bNewValue;
m_paiNoTradeTech[eIndex] = iNewValue;
}
// this new function should be called in doTurn
// instead of the current setNoTradeTech(((TechTypes)iI), false)
void CvTeam::decrementNoTradeTech(TechTypes eIndex)
{
FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
FAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");
if (m_paiNoTradeTech[eIndex] > 0)
{
m_paiNoTradeTech[eIndex] -= 1;
}
}