Actually, I don't know why I put these lines, they're completely wrong:
if (m_sources[m_nsources] = new EnergySource(r,c))
m_energy = FULL_ENERGY;
Using this made no difference, still error:
if (EnergySource(m_row, m_col)
I also tried the accessor for the Valley class:
bool energySourceAt(int r, int c) const
// If there is an energy source at coordinates (r,c), return true;
// otherwise, return false.
{
if (EnergySource(r,c))
return true;
else
return false;
}
For this, I once again got compilation errors.