Commit b83b2342 authored by Nelson Phillips's avatar Nelson Phillips

autosave

parents 2aad108b df7e2698
......@@ -2,7 +2,7 @@
#define C2048SCORESTATE_H
#include "GameState.h"
#include "../Testings/SaveLoad/SL2048.h"
#include "../SaveLoad/SL2048.h"
#include <iostream>
#include <string>
......
#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();
......
g++ *.cpp -o main.out -pthread -std=c++11 && ./main.out
\ No newline at end of file
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