fix results screen for final tournament match

This commit is contained in:
Martin Michelsen
2022-12-08 17:30:24 -08:00
parent 93f42a9398
commit 5f04cbaecb
5 changed files with 24 additions and 9 deletions
+2
View File
@@ -145,6 +145,8 @@ shared_ptr<const ServerBase> Server::base() const {
}
int8_t Server::get_winner_team_id() const {
// Note: This function is not part of the original implementation.
parray<size_t, 2> team_player_counts(0);
parray<size_t, 2> team_win_flag_counts(0);
for (size_t client_id = 0; client_id < 4; client_id++) {
+4
View File
@@ -345,6 +345,10 @@ shared_ptr<Tournament::Match> Tournament::next_match_for_team(
return nullptr;
}
shared_ptr<Tournament::Match> Tournament::get_final_match() const {
return this->final_match;
}
void Tournament::start() {
if (this->current_state != State::REGISTRATION) {
throw runtime_error("tournament has already started");
+1
View File
@@ -104,6 +104,7 @@ public:
std::shared_ptr<Team> get_team(size_t index) const;
std::shared_ptr<Team> get_winner_team() const;
std::shared_ptr<Match> next_match_for_team(std::shared_ptr<Team> team) const;
std::shared_ptr<Match> get_final_match() const;
void start();
void print_bracket(FILE* stream) const;