Jump to content
Sign in to follow this  
  • entries
    122
  • comments
    121
  • views
    68867

Item loader

Sign in to follow this  
Twisol

100 views

Well, so far so good. I've managed to make it "see" the 's' in the first line of the file, and then act to take in the number just after it. The code I have so far is below; still has mainly debugging cout statements, but at least I'm gettimg somewhere.


void LoadGame() // Still implementing
{
ifstream gameIn(file.c_str());
string line, prev;
do
{
gameIn >> line;
prev = line;
for (int i = 0; i < line.length(); i++)
{
cout << line;
if (line == 's')
{
i++;
cout << ": S will have ";
for (int it = i; line[it] != '!'; it++)
{
cout << line[it];
i++;
}
cout << " object." << endl;
}
break;
}
break;
cout << line << endl;
} while (!gameIn.eof() && line != prev);
gameIn.close();
}

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!