Quote:
Originally Posted by aznballerlee
EnergySource* m_sources[m_nsource] = new EnergySource(r,c);
m_nsource++
|
Almost - you don't need to redeclare m_sources as it is already in your Valley class. Delete the code in red.
Quote:
Originally Posted by aznballerlee
So would I need to add EnergySource* m_sources[MAXSOURCES]; as a private array?
|
Umm, you already have done that in your Valley class. I assumed you knew that as you said you had modified the code to add it:
From your original code in the Valley class:
private:
Robot* m_robots[MAXROBOTS];
int m_nrobots;
EnergySource* m_sources[MAXROBOTS];
int m_nsources;
};