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
a0dcf355
Commit
a0dcf355
authored
3 years ago
by
TheHresvelgian
Browse files
Options
Downloads
Patches
Plain Diff
commenting
parent
4e744363
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.h
+12
-11
12 additions, 11 deletions
src/kode/Tournament.h
src/kode/player.h
+2
-2
2 additions, 2 deletions
src/kode/player.h
with
14 additions
and
13 deletions
src/kode/Tournament.h
+
12
−
11
View file @
a0dcf355
...
@@ -22,17 +22,18 @@ class Tournament
...
@@ -22,17 +22,18 @@ class Tournament
{
{
public
:
public
:
int
nrOfTables
;
int
nrOfTables
;
//amount of tables in the tournament
int
currentRound
;
int
currentRound
;
//which round we are currently in, is updated in Tournament::printTables
int
nrOfRounds
;
int
nrOfRounds
;
//amount of rounds the tournament has total
vector
<
int
>
white
;
vector
<
int
>
white
;
//id of the players with white pieces in the current round, so white[0] is the id of the player with white pieces on table 1
vector
<
int
>
black
;
vector
<
int
>
black
;
//id of the players with black pieces in the current round, so black[0] is the id of the player with black pieces on table 1
//white and black are reset each round, but still needs to be saved
virtual
void
enterResults
();
//+
virtual
void
endTournament
();
//+
virtual
void
enterResults
();
//Enters the results after a round, goes through each table and asks the result before allowing the next round to start
virtual
void
printTables
();
//+
virtual
void
endTournament
();
//Goes if currentround is the final round, prints the final results
virtual
void
createMatchups
();
//+
virtual
void
printTables
();
//Calls createMatchups and prints the tables
bool
canStartRound
();
//+
virtual
void
createMatchups
();
//Figures out who should play against each other
bool
canStartRound
();
//Controls that the amount of tables and players correspond
void
writeToFileTournament
(
ofstream
&
out
);
//-
void
writeToFileTournament
(
ofstream
&
out
);
//-
void
readFromFileTournaments
(
ifstream
&
in
);
//-
void
readFromFileTournaments
(
ifstream
&
in
);
//-
...
...
This diff is collapsed.
Click to expand it.
src/kode/player.h
+
2
−
2
View file @
a0dcf355
...
@@ -26,8 +26,8 @@ class Player
...
@@ -26,8 +26,8 @@ class Player
float
score
;
float
score
;
vector
<
int
>
results
;
//stores the results of each match, 0 for loss, 1 for draw and 2 for win
vector
<
int
>
results
;
//stores the results of each match, 0 for loss, 1 for draw and 2 for win
vector
<
Player
*>
playedAgainst
;
vector
<
Player
*>
playedAgainst
;
//has every person they have played against
vector
<
bool
>
wasWhite
;
vector
<
bool
>
wasWhite
;
//true for each round the player had white pieces, false for black
Player
();
Player
();
Player
(
string
name
,
string
surName
,
string
clubName
,
int
rating
,
int
playerID
,
float
score
);
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