desocupado
Magister
- Joined
- Nov 17, 2008
- Messages
- 1,802
I've got a vector<Base_PC*> PC_List.
I'm putting inside this vector, pointers to objects of 2 classes derived from Base_PC. Fighter and Fire_Mage.
What I'm trying to do, I'm trying to have all my objects inside the same container, in this case, pointers to all my objects inside the same container.
The pointers to Fighter and Fire_Mage enter the container no problem, and using methods that were written in Base_PC, or that are virtual//pure virtual work fine.
However, when I call a method exclusive to Fighter (Fire_Mage is yet to have exclusive methods) like this:
(*point_PC_List)[index]->method(); //(The (*foo) is because I don't pass the vector itself, I pass a pointer)
The compiler shits itself and bitches about how I can't do that and how shitty a programmer I am.
I don't know how to solve this. I really would like to keep all my objects (or pointers to my objects) inside the same container because fuck me I already wrote a fuckton of code based on having all my objects(or pointers to my objects) inside the same container.
Any help you guys can give me?
I'm putting inside this vector, pointers to objects of 2 classes derived from Base_PC. Fighter and Fire_Mage.
What I'm trying to do, I'm trying to have all my objects inside the same container, in this case, pointers to all my objects inside the same container.
The pointers to Fighter and Fire_Mage enter the container no problem, and using methods that were written in Base_PC, or that are virtual//pure virtual work fine.
However, when I call a method exclusive to Fighter (Fire_Mage is yet to have exclusive methods) like this:
(*point_PC_List)[index]->method(); //(The (*foo) is because I don't pass the vector itself, I pass a pointer)
The compiler shits itself and bitches about how I can't do that and how shitty a programmer I am.
I don't know how to solve this. I really would like to keep all my objects (or pointers to my objects) inside the same container because fuck me I already wrote a fuckton of code based on having all my objects(or pointers to my objects) inside the same container.
Any help you guys can give me?