Oregon trail - classes

I have been trying to make a Oregon trail game and need some help on reading/writing files to read milestone names and distances. These are the pieces of what I have so far for that specific class. I am not sure how to add these functions in or how to finish the two functions correctly. I'd appreciate any help I can get

#include <milestones.h>
#include <iostream>
#include <string>

milestones::travelers()
{
name = "";
mileMarker = 0;
}

milestones::milestones(string name, int mileMarker)
{
setName(name);
setMileMarker(mileMarker);
}

void milestones::setName(string name)
{
name = name;
}

string milestones::getName()
{
return name;
}

void milestones::setMileMarker(int mileMarker)
{
mileMarker = mileMarker;
}

int milestones::getMileMarker()
{
return mileMarker;
}

//River Milestone
//choose to rest(repeatedly) or cross river
//cross river more than 3 ft deep requires a ferry
//costs money for ferry
//$10 per person

//Fort Milestone
//choose to rest, vist store, or continue

int riverMileStone(string fileName)
{
fileName = "river-milestone.txt";
ifstream myfilestream;
myfilestream.open(fileName);

if(myfilestream.is_open())
{
int lineIndex = 0;
string line1;
string line2;
while(getline(fileName, line1))
{
lineIndex++;
while(getline(fileName, line2))
{
line2.substr(); //bc line 2 has miles and depth
}
}
}

}

int fortMileStone(string fileName)
{
fileName = "fort-milestones.txt";
ifstream myfilestreaml
myfilestream.open(fileName);

if(myfilestream.is_open())
{
int lineIndex = 0;
string line1; //name
string line2; //milesmarker
while(getline(fileName, line1))
{

}

}
}
Topic archived. No new replies allowed.