1#ifndef HEADTOHEADRESULTS_H
2#define HEADTOHEADRESULTS_H
10#include <qx/core/qx-cumulation.h>
18class HeadToHeadResults
22 enum NarrowMode{ Inclusive, Exclusive };
28 QSet<QString> victories;
29 QSet<QString> defeats;
30 Qx::Cumulation<QString, int> preferences;
31 Qx::Cumulation<QString, int> antiPreferences;
36 QHash<QString, CandidateStats> mStats;
43 HeadToHeadResults(
const Election* election);
47 void faceOffStatsUpdate(
const QString& can,
int canPref,
const QString& opp,
int oppPref);
50 int wins(
const QString& candidate)
const;
51 int losses(
const QString& candidate)
const;
52 int preferences(
const QString& candidate)
const;
53 int margin(
const QString& candidate)
const;
54 QString winner(
const QString& candidateA,
const QString& candidateB)
const;
56 qsizetype candidateCount()
const;
57 QSet<QString> candidates()
const;
59 void narrow(QSet<QString> candidates, NarrowMode mode);
60 HeadToHeadResults narrowed(QSet<QString> candidates, NarrowMode mode);
The Star namespace is the main namespace through which all functionality of the STAR++ library is acc...
Definition calculator.cpp:21