Commit df7e2698 authored by Kyle Malaguit's avatar Kyle Malaguit

autosave

parent c86a7074
#include "SL2048.h"
void SL2048::LoadContainers(){
void SL2048::LoadContainers(string fileName){
ifstream fin;
fin.open("2048Data.txt");
fin.open(fileName);
if(!fin.is_open()){
cerr << "Could not open file.\n";
exit(0);
......
......@@ -15,7 +15,7 @@ using namespace std;
class Scores;
class SL2048 : public SaveLoad{
public:
void LoadContainers();
void LoadContainers(string fileName);
void updateFile(string fileName);
};
......
#include "SLSnake.h"
void SLSnake::LoadContainers(){
void SLSnake::LoadContainers(string fileName){
ifstream fin;
fin.open("snakedata.txt");
fin.open(fileName);
if(!fin.is_open()){
cerr << "Could not open file.\n";
exit(0);
......
......@@ -15,7 +15,7 @@ using namespace std;
class Scores;
class SLSnake : public SaveLoad{
public:
void LoadContainers();
void LoadContainers(string fileName);
void updateFile(string fileName);
};
......
......@@ -18,8 +18,8 @@ class SaveLoad {
public:
//these functions change the files data
virtual void LoadContainers() = 0;
virtual void updateFile() = 0;
virtual void LoadContainers(string fileName) = 0;
virtual void updateFile(string fileName) = 0;
//add new data into file
void sortByScore();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment