本文整理汇总了C++中Match类的典型用法代码示例。如果您正苦于以下问题:C++ Match类的具体用法?C++ Match怎么用?C++ Match使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Match类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qWarning
void ShtServer::onMatchFinished(const QString &uuid)
{
qWarning() << "OnMatchFinished, uuid: " << uuid;
Match *m = findMatch(uuid);
matches.removeOne(m);
m->deleteLater();
}
示例2: main
void main() {
int gamesettings[7] = {0};
Player players[2] = {Player(), Player()};
Match match;
match = Match();
SetUpGame(gamesettings, players);
for (int i = gamesettings[gamestoplay]; i > 0; i--) {
match.Play(players, gamesettings);
}
cout << players[0].GetName() << "\t:\t" << players[1].GetName() << endl << endl;
cout << players[0].matchwins << "\t:\t" << players[1].matchwins << endl << endl;
for (int i = 0; i < 7; i++) {
cout << "7\t:\t" << i << "\t:\t" << (float)(players[0].windensity[i]*100)/gamesettings[gamestoplay] << "%" << endl;
}
for (int i = 0; i < 7; i++) {
cout << i << "\t:\t7\t:\t" << (float)(players[1].windensity[i]*100)/gamesettings[gamestoplay] << "%" << endl;
}
while(true){}
}
示例3: _T
void MatchView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
// TODO: 在此添加专用代码和/或调用基类
list_match.SetExtendedStyle(LVS_EX_FULLROWSELECT);
list_match.InsertColumn(0, _T("比赛名称"), LVCFMT_CENTER);
list_match.InsertColumn(1, _T("举办时间"), LVCFMT_CENTER);
CHeaderCtrl* pHeader = list_match.GetHeaderCtrl();
int nCurrWidth, nColHdrWidth;
ASSERT(pHeader);
list_match.SetRedraw(FALSE);
for(int iCurrCol = 0; iCurrCol < pHeader->GetItemCount(); ++iCurrCol){
list_match.SetColumnWidth(iCurrCol, LVSCW_AUTOSIZE);
nCurrWidth = list_match.GetColumnWidth(iCurrCol);
list_match.SetColumnWidth(iCurrCol, LVSCW_AUTOSIZE_USEHEADER);
nColHdrWidth = list_match.GetColumnWidth(iCurrCol);
list_match.SetColumnWidth(iCurrCol, max(nCurrWidth, nColHdrWidth));
}
list_match.SetRedraw(TRUE);
list_match.Invalidate();
Match mat;
mat._meeting.ID = this->meetingID;
vector<Match> v_match = mat.Query();
vector<Match>::iterator i_d;
for(i_d = v_match.begin(); i_d != v_match.end(); ++i_d){
AddMatToList(&(*i_d));
}
}
示例4: write
bool IndexParseData::write(const std::function<bool(const String &)> &write, const Match &match) const
{
auto process = [&write, &match](const String &str, const Sources &sss) {
if (!sss.isEmpty()) {
if (!write(str + ":"))
return false;
for (const auto &ss : sss) {
const Path file = Location::path(ss.first);
if (match.isEmpty() || match.match(file)) {
write(" " + file + ":");
for (const auto &s : ss.second) {
if (!write(" " + s.toString()))
return false;
}
}
}
}
return true;
};
if (!process("Sources", sources))
return false;
for (const auto &commands : compileCommands) {
if (!process(Location::path(commands.first), commands.second.sources))
return false;
}
return true;
}
示例5: convert
void Generator::convert(const Match & match,const GroebnerRule & r1,
const GroebnerRule & r2,Polynomial & result) const {
result.doubleProduct(match.const_left1(),r1.RHS(),match.const_right1());
Polynomial temp;
temp.doubleProduct(match.const_left2(),r2.RHS(),match.const_right2());
result -= temp;
};
示例6: operator
bool operator() (const Match& a, const Match& b) const {
Location la = a.getTarget();
Location lb = b.getTarget();
long sa = score(la);
long sb = score(lb);
return sa < sb;
}
示例7: SerializeMatch
void SerializeMatch(Writer &writer, const Match &match) {
writer.StartObject();
writer.Key("startEA");
writer.Uint(match.getStartEA().getValue());
writer.Key("endEA");
writer.Uint(match.getEndEA().getValue());
writer.Key("patternName");
writer.String(match.getPatternName());
writer.EndObject();
}
示例8:
Match * UserHandler::getMatch() {
for (int i = 0; i < shared_data_->match_list.size(); i++) {
Match * m = shared_data_->match_list.at(i);
if ((m->getClubs()[0] == manager_->getClub()) || (m->getClubs()[1] == manager_->getClub())) {
return m;
}
}
return NULL;
}
示例9: main
int main(void)
{
Time t (6,34,25);
Match m;
m.printTime(t);
//printTime(t);
system("pause");
return 0;
}
示例10: OnBnClickedBuMDel
void MatchView::OnBnClickedBuMDel()
{
// TODO: 在此添加控件通知处理程序代码
if(MessageBox(_T("确定删除所选比赛吗?"), _T("确认"), MB_YESNO | MB_ICONQUESTION) == IDNO)
return;
int n_se = list_match.GetSelectionMark();
Match mat;
mat.ID = list_match.GetItemData(n_se);
mat.Delete();
list_match.DeleteItem(n_se);
}
示例11: linkToMatch
bool BracketVisElement::linkToMatch(const Match& ma) const
{
Category myCat = getLinkedCategory();
if (ma.getCategory() != myCat) return false;
// lock the database before writing
DbLockHolder lh{db, DatabaseAccessRoles::MainThread};
row.update(BV_MATCH_REF, ma.getId());
return true;
}
示例12: drawMatch
void PairWiseDrawer::drawMatch(const Match& m, const Color3ub& c, bool drawLine) const
{
drawFeature(0, m.x(), c);
drawFeature(1, m.y(), c);
if(drawLine)
{
Vector2f a,b;
a = scale(0)*m.posX(); b = scale(1)*(m.posY()+offF(1));
DO::drawLine(a, b, c);
}
}
示例13: i
/** removes player from players list and removes
* all matches which he/she had participated
*/
void Group::removePlayer( Player player )
{
_players.removeOne( player );
QMutableListIterator<Match> i( _matches );
while( i.hasNext() ) {
Match m = i.next();
if ( ( m.playerA() == player ) ||
( m.playerB() == player ) ) {
i.remove();
}
}
}
示例14: earnedRating
/** \return earned rating for 'p' player. i.e. the sum of
* earned points per each match.
*/
double Group::earnedRating( Player p ) const
{
double total = 0.0;
for ( int i = 0; i < _matches.count(); i++) {
Match m = _matches.at( i );
if ( m.participated( p ) && m.played() ) {
total += m.earnedRating( p );
}
}
return total;
}
示例15: query
bool DataBase::_insertMatch(const Match &match) {
QSqlQuery query(_db);
query.prepare("insert into Match (match_id, time_stamp, game_type)"\
" values(?, ?, ?)");
query.addBindValue(match.getId());
query.addBindValue(match.getDate().toTime_t());
query.addBindValue(static_cast<int>(match.getMatchType()));
if (!query.exec()) {
qCritical() << "Could not insert match!\n";
return false;
}
return _insertMatchDetails(match.getDetails());
}