I am just now learning about classes and objects and arrays and well, everything, and I need to know how to make an array out of a set of class member variables. I used to program in qbasic and I did it there but I cant remember how it has been too long...here is a snipet of code so I can clarify what I am asking:
class Unit
{
private:
float Id;
int TypeId;
int MaxHp;
int Hp;
int Range;
int Power;
int Move;
int Cost;
int Type;
public:
//to create a new unit
void CreateUnit(int TypeId)
//to delete an old unit
void DeleteUnit(float Id)
};
Bassically I want to be able to do this (what I did in qbasic):
Unit[1].Hp = Unit[1].Hp - 20
as an example of unit id number 1 having its hp decreased by 20 points... then still have 2,3,4,5,6 and so on, with access to all of the member variables. I have no way to compile right now(am at work) so I figured I would post and see If I get an answer before I try to code something.