While i'm not new to programming i've been programming for the last 10 years since i was in 7th grade, and unfortunately i am self taught ( i see this as a good thing and a bad thing times) so here is my issue, I've been working on a mud code base on and off for the last few i decided to start back from scratch with the idea of actually planning it out and having goals so that i don't encounter feature creep and to make it easier to implement scripting
so i got all my networking running and logins and stuff working so i sat down to create a base game object that would hold common settings to all obejects
//objects.h
class cObject
{
public:
cObject();
cObject(cObject & Object);
~cObject();
int Save(cGwmlFile &File);
/*cGwmlFile is my markup language custom file libary */
int Load(cGwmlFile &File);
cBuffer Name;
long ID;
protected:
};
and here is my second header file describing the player object, if i understand things correctly and i'm using the correct terminology *crosses fingers* it has an overloaded int save() which is passed (const char *) for a filename to open the selected cGwmlFile.
[source lang= "cpp"]
//player.h
#include "objects.h"
class cPlayer: public cObject
{
public:
cPlayer();
cPlayer(cPlayer & Player);
~cPlayer();
int Load(const char * cpFileName);
int Save(const char * cpFileName);
private:
};
now here is a quick example of what i want to do
[source lang = "cpp"]
//player.cpp
int cPlayer::Load(const char * cpFileName)
{
cGwmlFile File;
if(File.Open(cpFileName))
{
/* i load the player base file structure here
and then i wanted to call the int cObject::Load(cGwmlFile & File)
function to finish loading the default Object information
*/
Load(File); // <---- Error
/*here is the error i'm getting
error: no matching function for call to `cPlayer::Load(cGwmlFile&)'
*/
return 1;
}
return 0;
}
i thought that because cPlayer is derived from cObject that would be a ble to the cObject::Load(cGwmlFile & File) from with in the overloaded cPlayer(const char * FileName) with out having to rewrite that portion of the code
any help would be appreciated this is a cut down version of my code but it creates the same error i'm having from my main code base and was hoping that this would make it easier to find either a solution to my issue or help me find a work around thanks
edited to put source in source blocks