hi guys,
i've been battling with this program for too long now... i cant seem to get it to compile. i believe the problem lies in my use of objects being passed to different classes as parameters.
(i will do my best to only paste code that i believe is causing the issues. if more is needed, let me know.)
the program is a typing tutor... i created a superclass, difficultyLvl.h, to contain all the variables and a declaration of 3 virtual functions:
// Procedural functions
virtual string wordList() = 0; // random word list virtual method
virtual void gameEvent(gameSequence &pobjSequence) = 0; // game logic for coward difficulty level virtual method
virtual void gameConsole(gameSequence &pobjSequence) = 0; // game console virtual method
// End procedural functions
from this i have two subclasses, gui.h (containing console ascii art), and gameSequence.h, containing the main game method.
the object is declared in main, as it should be:
//**********Object Declarations**************
gameSequence objSequence(0, "XXXXX", "", "", "Start", " ", 0, " ");
difficultyLvl * pobjSequence = &objSequence; // Declare the main object to drive gameSequence/difficultyLvl classes
gui objVisuals; // declare the visuals object to display gui methods from main
Wpm wpm; // declare wpm object
difficultySelection objDifSelection; // object to drive difficulty selection menu
//**********End Object Declarations**********
and, this is where i believe the trouble hits. I need to then pass this object to the subclasses to opperate off of. this is how i launch my main game sequence from main:
//**************** LAUNCH THE MAIN GAME DRIVER METHOD ****************
pobjSequence->gameEvent(pobjSequence); // launch game sequence
//**************** END LAUNCH THE MAIN GAME DRIVER METHOD ************
i also, later in main, request the gui.h class to display the gameOver console using this object to display the results:
objVisuals.gameOver(gameSequence &pobjSequence); // display game over screen
in the next post i will display my gui.h and gameSequence.h header files...