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
6ba21b5f
Commit
6ba21b5f
authored
Mar 12, 2019
by
Nelson Phillips
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.cs.wallawalla.edu:philne/142GameCenter
parents
ac635381
7156b14c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
11 deletions
+14
-11
Testings/SaveLoad/2048Data.txt
Testings/SaveLoad/2048Data.txt
+1
-0
Testings/SaveLoad/SL2048.cpp
Testings/SaveLoad/SL2048.cpp
+3
-2
Testings/SaveLoad/SL2048.h
Testings/SaveLoad/SL2048.h
+1
-1
Testings/SaveLoad/SLSnake.cpp
Testings/SaveLoad/SLSnake.cpp
+2
-2
Testings/SaveLoad/SLSnake.h
Testings/SaveLoad/SLSnake.h
+1
-1
Testings/SaveLoad/SaveLoad.cpp
Testings/SaveLoad/SaveLoad.cpp
+0
-1
Testings/SaveLoad/SaveLoad.h
Testings/SaveLoad/SaveLoad.h
+6
-4
No files found.
Testings/SaveLoad/2048Data.txt
View file @
6ba21b5f
...
...
@@ -5,6 +5,7 @@ vds 10000
NEL 10000
PHI 10000
BAG 10000
mmm 10000
BVB 9240
BND 6564
CDS 6544
...
...
Testings/SaveLoad/SL2048.cpp
View file @
6ba21b5f
...
...
@@ -26,9 +26,10 @@ void SL2048::LoadContainers(){
fin
.
close
();
}
void
SL2048
::
updateFile
(){
void
SL2048
::
updateFile
(
string
fileName
){
ofstream
fout
;
fout
.
open
(
"2048Data.txt"
,
ofstream
::
out
|
ofstream
::
trunc
);
fout
.
open
(
fileName
,
ofstream
::
out
|
ofstream
::
trunc
);
//delete file contents
fout
<<
"NAME"
<<
"
\t
"
<<
"SCORE"
<<
endl
;
for
(
auto
scoresFull
:
scores
){
...
...
Testings/SaveLoad/SL2048.h
View file @
6ba21b5f
...
...
@@ -16,7 +16,7 @@ class Scores;
class
SL2048
:
public
SaveLoad
{
public:
void
LoadContainers
();
void
updateFile
();
void
updateFile
(
string
fileName
);
};
#endif
\ No newline at end of file
Testings/SaveLoad/SLSnake.cpp
View file @
6ba21b5f
...
...
@@ -25,10 +25,10 @@ void SLSnake::LoadContainers(){
fin
.
close
();
}
void
SLSnake
::
updateFile
(){
void
SLSnake
::
updateFile
(
string
fileName
){
ofstream
fout
;
//delete date in snake data file
fout
.
open
(
"snakedata.txt"
,
ofstream
::
out
|
ofstream
::
trunc
);
fout
.
open
(
fileName
,
ofstream
::
out
|
ofstream
::
trunc
);
//update
fout
<<
"NAME"
<<
"
\t
"
<<
"SCORE"
<<
endl
;
...
...
Testings/SaveLoad/SLSnake.h
View file @
6ba21b5f
...
...
@@ -16,7 +16,7 @@ class Scores;
class
SLSnake
:
public
SaveLoad
{
public:
void
LoadContainers
();
void
updateFile
();
void
updateFile
(
string
fileName
);
};
#endif
\ No newline at end of file
Testings/SaveLoad/SaveLoad.cpp
View file @
6ba21b5f
...
...
@@ -40,7 +40,6 @@ void SaveLoad::userInputNameMakeScore(int intScore){
}
catch
(
runtime_error
&
ex
){
cout
<<
ex
.
what
()
<<
endl
;
cout
<<
userNameInput
<<
endl
;
}
}
while
(
true
);
...
...
Testings/SaveLoad/SaveLoad.h
View file @
6ba21b5f
...
...
@@ -16,22 +16,24 @@ using namespace std;
class
Scores
;
class
SaveLoad
{
public:
//these functions change the files data
virtual
void
LoadContainers
()
=
0
;
virtual
void
updateFile
()
=
0
;
//add new data into file
void
pushBackNewScoreAndSort
(
Scores
Score
);
void
sortByScore
();
static
bool
sortAscending
(
Scores
,
Scores
);
void
userInputNameMakeScore
(
int
intScore
);
//display scores in the bash
void
displayScores
();
//function for comparing
static
bool
sortAscending
(
Scores
,
Scores
);
protected:
vector
<
Scores
>
scores
;
void
pushBackNewScoreAndSort
(
Scores
Score
);
};
...
...
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