Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG1004_2022_group4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Magnus Westerheim Johannessen
PROG1004_2022_group4
Commits
34319c89
Commit
34319c89
authored
3 years ago
by
TheHresvelgian
Browse files
Options
Downloads
Patches
Plain Diff
played against now stores playerIDs instead of pointers to enable saving
parent
1963920e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kode/Tournament.cpp
+2
-2
2 additions, 2 deletions
src/kode/Tournament.cpp
src/kode/player.h
+1
-1
1 addition, 1 deletion
src/kode/player.h
with
3 additions
and
3 deletions
src/kode/Tournament.cpp
+
2
−
2
View file @
34319c89
...
...
@@ -29,8 +29,8 @@ void Tournament::enterResults()
cout
<<
endl
<<
"Enter results for round "
<<
currentRound
;
for
(
int
i
=
0
;
i
<
nrOfTables
;
++
i
)
{
playerList
[
searchByID
(
white
[
i
],
playerList
)]
->
playedAgainst
.
push_back
(
playerList
[
searchByID
(
black
[
i
],
playerList
)]);
playerList
[
searchByID
(
black
[
i
],
playerList
)]
->
playedAgainst
.
push_back
(
playerList
[
searchByID
(
white
[
i
],
playerList
)]);
playerList
[
searchByID
(
white
[
i
],
playerList
)]
->
playedAgainst
.
push_back
(
playerList
[
searchByID
(
black
[
i
],
playerList
)]
->
playerID
);
playerList
[
searchByID
(
black
[
i
],
playerList
)]
->
playedAgainst
.
push_back
(
playerList
[
searchByID
(
white
[
i
],
playerList
)]
->
playerID
);
playerList
[
searchByID
(
white
[
i
],
playerList
)]
->
white
++
;
int
answer
;
cout
<<
endl
<<
"Enter results for table "
<<
i
+
1
<<
"with "
...
...
This diff is collapsed.
Click to expand it.
src/kode/player.h
+
1
−
1
View file @
34319c89
...
...
@@ -27,7 +27,7 @@ class Player
float
score
;
vector
<
int
>
results
;
//stores the results of each match, 0 for loss, 1 for draw and 2 for win
vector
<
Player
*
>
playedAgainst
;
//has every person they have played against
vector
<
int
>
playedAgainst
;
//has every person they have played against
Player
();
Player
(
string
name
,
string
surName
,
string
clubName
,
int
rating
,
int
playerID
,
float
score
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment