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
0c950b47
Commit
0c950b47
authored
Mar 14, 2019
by
Kyle Malaguit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
caa566d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
SaveLoad/SaveLoad.cpp
SaveLoad/SaveLoad.cpp
+9
-1
SaveLoad/SaveLoad.h
SaveLoad/SaveLoad.h
+1
-0
SaveLoad/main.cpp
SaveLoad/main.cpp
+5
-0
No files found.
SaveLoad/SaveLoad.cpp
View file @
0c950b47
...
...
@@ -61,5 +61,13 @@ void SaveLoad::printScoreIfLessThan10(Scores findScore){
cout
<<
"Score not found"
<<
endl
;
}
// cout << iter << " " << scores.at(iter).getName << " " << scores.at(iter).getScore << endl;
}
void
SaveLoad
::
useRankFindScore
(
int
rank
){
if
(
rank
>=
scores
.
size
()
||
rank
<=
0
){
cout
<<
"Outside of total scores..."
<<
endl
;
return
;
}
Scores
foundScore
=
scores
.
at
(
rank
-
1
);
cout
<<
"At rank "
<<
rank
<<
" player "
<<
foundScore
.
getName
()
<<
" has a score of "
<<
foundScore
.
getScore
()
<<
endl
;
}
\ No newline at end of file
SaveLoad/SaveLoad.h
View file @
0c950b47
...
...
@@ -32,6 +32,7 @@ class SaveLoad {
void
printScoreIfLessThan10
(
Scores
);
//one that passes a position and returns the line in the vector
void
useRankFindScore
(
int
rank
);
//function for comparing
static
bool
sortAscending
(
Scores
,
Scores
);
...
...
SaveLoad/main.cpp
View file @
0c950b47
...
...
@@ -20,6 +20,11 @@ int main(){
Scores
fScore
(
"cdo"
,
21474
);
second
.
printScoreIfLessThan10
(
fScore
);
second
.
useRankFindScore
(
0
);
second
.
useRankFindScore
(
100
);
second
.
useRankFindScore
(
9
);
second
.
useRankFindScore
(
5
);
return
0
;
}
...
...
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