[Dev-C++] Loading variables from files [C++]
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Samuel H. <tal...@gm...> - 2008-04-28 05:40:22
|
Hi,
I am attempting to load variables from files but im not sure what
todo because the variables are different types and sizes.
Here is the source:
#pragma once
#include <fstream>
using namespace std;
class hero
{
public:
void setname(string first, string last)
{
fname = first;
lname = last;
return;
}
void setmap(int mp)
{
mapid = mp;
return;
}
void setpos(int x, int y)
{
posx = x;
posy = y;
return;
}
void setmapx(int x)
{
posx = x;
return;
}
void setmapy(int y)
{
posy = y;
return;
}
int getmap()
{
return mapid;
}
int getmapx()
{
return posx;
}
int getmapy()
{
return posy;
}
void loadinfo()
{
// This is where I will load the config.
}
private:
// Map variables.
int mapid;
int posx;
int posy;
};
Yours Truly
Samuel Hulley.
|