Polymorphism and passing

Posted by Tucker Morgan on Programmers See other posts from Programmers or by Tucker Morgan
Published on 2012-03-31T05:06:35Z Indexed on 2012/03/31 5:39 UTC
Read the original article Hit count: 484

Filed under:

Ok i am going to try and state my question as clearly as possible, but if you have trouble understanding it please just ask for clarification, i really want to figure out how to do this. I am writing a text based RPG, and i have three class that inherit from a super class, they all have special attacks that they can preform, at the same time i have a class that holds the function which handles battles in my game. Now how do i get the unique special abilities functions for whatever role the player chooses into the battle function. Also i am using the vector.push_back method to handle how my sub classes are referenced Please help me your my only hope

© Programmers or respective owner

Related posts about c++