Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
1
142GameCenter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nelson Phillips
142GameCenter
Commits
df7e2698
Commit
df7e2698
authored
Mar 12, 2019
by
Kyle Malaguit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
c86a7074
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
SaveLoad/SL2048.cpp
SaveLoad/SL2048.cpp
+2
-2
SaveLoad/SL2048.h
SaveLoad/SL2048.h
+1
-1
SaveLoad/SLSnake.cpp
SaveLoad/SLSnake.cpp
+2
-2
SaveLoad/SLSnake.h
SaveLoad/SLSnake.h
+1
-1
SaveLoad/SaveLoad.h
SaveLoad/SaveLoad.h
+2
-2
No files found.
SaveLoad/SL2048.cpp
View file @
df7e2698
#include "SL2048.h"
#include "SL2048.h"
void
SL2048
::
LoadContainers
(){
void
SL2048
::
LoadContainers
(
string
fileName
){
ifstream
fin
;
ifstream
fin
;
fin
.
open
(
"2048Data.txt"
);
fin
.
open
(
fileName
);
if
(
!
fin
.
is_open
()){
if
(
!
fin
.
is_open
()){
cerr
<<
"Could not open file.
\n
"
;
cerr
<<
"Could not open file.
\n
"
;
exit
(
0
);
exit
(
0
);
...
...
SaveLoad/SL2048.h
View file @
df7e2698
...
@@ -15,7 +15,7 @@ using namespace std;
...
@@ -15,7 +15,7 @@ using namespace std;
class
Scores
;
class
Scores
;
class
SL2048
:
public
SaveLoad
{
class
SL2048
:
public
SaveLoad
{
public:
public:
void
LoadContainers
();
void
LoadContainers
(
string
fileName
);
void
updateFile
(
string
fileName
);
void
updateFile
(
string
fileName
);
};
};
...
...
SaveLoad/SLSnake.cpp
View file @
df7e2698
#include "SLSnake.h"
#include "SLSnake.h"
void
SLSnake
::
LoadContainers
(){
void
SLSnake
::
LoadContainers
(
string
fileName
){
ifstream
fin
;
ifstream
fin
;
fin
.
open
(
"snakedata.txt"
);
fin
.
open
(
fileName
);
if
(
!
fin
.
is_open
()){
if
(
!
fin
.
is_open
()){
cerr
<<
"Could not open file.
\n
"
;
cerr
<<
"Could not open file.
\n
"
;
exit
(
0
);
exit
(
0
);
...
...
SaveLoad/SLSnake.h
View file @
df7e2698
...
@@ -15,7 +15,7 @@ using namespace std;
...
@@ -15,7 +15,7 @@ using namespace std;
class
Scores
;
class
Scores
;
class
SLSnake
:
public
SaveLoad
{
class
SLSnake
:
public
SaveLoad
{
public:
public:
void
LoadContainers
();
void
LoadContainers
(
string
fileName
);
void
updateFile
(
string
fileName
);
void
updateFile
(
string
fileName
);
};
};
...
...
SaveLoad/SaveLoad.h
View file @
df7e2698
...
@@ -18,8 +18,8 @@ class SaveLoad {
...
@@ -18,8 +18,8 @@ class SaveLoad {
public:
public:
//these functions change the files data
//these functions change the files data
virtual
void
LoadContainers
()
=
0
;
virtual
void
LoadContainers
(
string
fileName
)
=
0
;
virtual
void
updateFile
()
=
0
;
virtual
void
updateFile
(
string
fileName
)
=
0
;
//add new data into file
//add new data into file
void
sortByScore
();
void
sortByScore
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment