View Single Post
Old Nov 30th, 2006, 5:59 PM   #15
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
Quote:
Originally Posted by aznballerlee View Post
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 View Post
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;
};
The Dark is offline   Reply With Quote