Reading variables from input.

https://github.com/Metalhead33/Faulty-code./blob/master/.thecode.cpp
Here is the code.

While reading text and printing it on the screen is something I can do, I want something different here.
You see, there are the classes for a character's race, class, etc.
I want to have something like this:
Being able to read a class/race/weapon from a file, which includes its variables.

A weapon has these attributes, for examplke:

string w_display_name;
float w_minatk;
float w_maxatk;
float w_cond;
float w_cost;
material w_mat;
element w_elem;
w_type w_usage;
w_type2 w_kind;

So the iron_sword.dat, shortbow.dat, etc. would contain something like this:

w_setname="N\\A"
w_setmin=0
w_setmax=0
w_setcond=0
w_setcost=0
w_setmat=a_none
w_setelem=m_none
w_settype=blunt
w_kind=crude

How would I make the program read such a file?
Topic archived. No new replies allowed.