您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ team函数代码示例

51自学网 2021-06-03 08:43:15
  C++
这篇教程C++ team函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中team函数的典型用法代码示例。如果您正苦于以下问题:C++ team函数的具体用法?C++ team怎么用?C++ team使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了team函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: addTeam

void TeamHolder::load(){    QSettings s;    m_teams.clear();    if (!s.contains("Teams/Locations")) {        addTeam();        setCurrent(0);    } else {        QStringList l = s.value("Teams/Locations").toStringList();        for (int i = 0; i < l.length(); i++) {            addTeam();            team(i).loadFromFile(l[i]);        }        if (count() == 0) {            addTeam();            setCurrent(0);        } else {            if (currentTeam() >= count()) {                setCurrent(count()-1);            }        }    }    if (!team().path().isEmpty()) {        s.setValue("Teams/Folder", team().folder());    }    profile().loadFromFile(s.value("Profile/Current").toString());}
开发者ID:Alicirno,项目名称:pokemon-online,代码行数:32,


示例2: updateTeam

void TrainerMenu::updateTeam(){    ui->pokemonButtons->setTeam(team().team());    ui->teamName->setText(team().team().name());    ui->teamTier->setText(team().team().defaultTier());    updateButtonName();}
开发者ID:Airisu,项目名称:pokemon-online,代码行数:7,


示例3: sendMessage

void Player::changeTier(const QString &newtier){    if (tier() == newtier)        return;    if (battling()) {        sendMessage(tr("You can't change tiers while battling."));        return;    }    if (!TierMachine::obj()->exists(newtier)) {        sendMessage(tr("The tier %1 doesn't exist!").arg(newtier));        return;    }    if (!TierMachine::obj()->isValid(team(), newtier)) {        Tier *tier = &TierMachine::obj()->tier(newtier);        if (!tier->allowGen(team().gen)) {            sendMessage(tr("The generation of your team is invalid for that tier."));            return;        }        QList<int> indexList;        for(int i = 0; i < 6; i++) {            if (tier->isBanned(team().poke(i))) {                indexList.append(i);            }        }        if (indexList.size() > 0) {            foreach(int i, indexList) {                sendMessage(tr("The Pokemon '%1' is banned on tier '%2' for the following reasons: %3").arg(PokemonInfo::Name(team().poke(i).num()), newtier, tier->bannedReason(team().poke(i))));            }
开发者ID:Antar1011,项目名称:pokemon-online-1.0.53,代码行数:31,


示例4: QBrush

void Robotcl::drawRobot(QPainter *painter){    painter->save();    painter->translate(px,py);    QPen pen;    QBrush brush;    if(team() == Blue)    {        if(Field::SelectedRobotID == ID)            pen.setColor(Qt::white);        else            pen.setColor(Qt::blue);        brush = QBrush(QColor("blue"));    }    else if(team()==Yellow)    {        if(Field::SelectedRobotID == ID)            pen.setColor(Qt::white);        else            pen.setColor(Qt::yellow);        brush = QBrush(QColor("Yellow"));    }    QPainterPath robotPath;    robotPath.moveTo(-diagonal/2.0,-diagonal/2.0);    robotPath.arcMoveTo(-diagonal/2.0,-diagonal/2.0,diagonal,diagonal,0);    robotPath.arcTo(-diagonal/2.0,-diagonal/2.0,diagonal,diagonal,0,290.0);    pen.setWidth(10);    painter->setPen(pen);    qreal rotateAngle = 35.0;    painter->rotate(orientation()-rotateAngle);    painter->fillPath(robotPath,brush);    painter->rotate(-(orientation()-rotateAngle));    QRectF rect;    pen.setWidth(20);    if(Field::SelectedRobotID == ID)        pen.setColor(Qt::white);    else        pen.setColor(Qt::black);    painter->setPen(pen);    painter->setBrush(Qt::NoBrush);    painter->setFont(QFont("Tahoma",100));    rect = painter->boundingRect(rect,QString::number(ID));    painter->scale(1,-1);    painter->drawText(0,0 ,rect.width() ,rect.height() ,0 ,QString::number(ID));    painter->restore();}
开发者ID:rhajizadeh,项目名称:Kavak_robocup,代码行数:60,


示例5: setColor

void TrainerMenu::setColor(){    if (team().color().isValid()) {        ui->colorButton->setStyleSheet(QString("background: %1; color: white;").arg(team().color().name()));    } else {        ui->colorButton->setStyleSheet("");    }}
开发者ID:Airisu,项目名称:pokemon-online,代码行数:8,


示例6: team

void TrainerMenu::on_addTeam_clicked(){    if (team().count() >= 6) {        return;    }    team().addTeam();    updateTeamButtons();}
开发者ID:Airisu,项目名称:pokemon-online,代码行数:10,


示例7: loadProfileList

void TrainerMenu::loadProfileList(){    QSettings s;    ui->profileList->blockSignals(true);    ui->profileList->addItems(team().profile().getProfileList(s.value("Profile/Path").toString()));    ui->profileList->blockSignals(false);    for (int i = 0; i < ui->profileList->count(); i++) {        if (ui->profileList->itemText(i) == team().profile().name()) {            ui->profileList->setCurrentIndex(i);            return;        }    }}
开发者ID:Airisu,项目名称:pokemon-online,代码行数:14,


示例8: GetTeamEnts

	// gets the blu and red team entities and puts them in the pointers passed in	void GetTeamEnts( CSizzPluginContext *context, CBaseEntity **ppBluTeam, CBaseEntity **ppRedTeam )	{		if (context && ppBluTeam && ppRedTeam)		{			*ppBluTeam = NULL;			*ppRedTeam = NULL;			edict_t *pTeamEdict = context->GetEntityByClassName("CTFTeam", context->GetMaxClients());			while (pTeamEdict && (!(*ppBluTeam) || !(*ppRedTeam)))			{				CBaseEntity *pTeam = SCHelpers::EdictToBaseEntity(pTeamEdict);				if (pTeam)				{					CTFTeamWrapper team(pTeam);					unsigned int team_num = team.GetTeamID();					if (team_num == 2)					{						*ppRedTeam = pTeam;					}					else if (team_num == 3)					{						*ppBluTeam = pTeam;					}				}				int ent_index = SCHelpers::EntIndexFromEdict(pTeamEdict);				pTeamEdict = context->GetEntityByClassName("CTFTeam", ent_index+1);			}		}	}
开发者ID:SizzlingStats,项目名称:sizzlingplugins,代码行数:30,


示例9: TBBWork

void TBBWork() {    if( AvailWork>=0 ) {        int k = --AvailWork;        if( k==-1 ) {            TBB_RunTime.server->adjust_job_count_estimate(-(TBB_MaxThread-1));            ++CompletionCount;        } else if( k>=0 ) {            for( int k=0; k<4; ++k ) {                OMP_Team team( *OMP_RunTime.server );                int n = OMP_RunTime.server->try_increase_load( OMP_ParallelRegionSize-1, /*strict=*/false );                team.barrier = 0;                ::rml::job* array[OMP_ParallelRegionSize-1];                if( n>0)                    OMP_RunTime.server->get_threads( n, &team, array );                // Master does work inside parallel region too.                OMPWork();                // Master waits for workers to finish                if( n>0 )                    while( team.barrier!=unsigned(n) ) {                        __TBB_Yield();                    }             }            ++CompletionCount;        }    }}
开发者ID:cran,项目名称:RcppParallel,代码行数:26,


示例10: sender

void TeamMenu::tabIconChanged(){    int slot = sender()->property("slot").toInt();    ui->pokemonTabs->setTabIcon(slot, PokemonInfo::Icon(team().team().poke(slot).num()));    emit teamChanged();}
开发者ID:CarnegieJames,项目名称:pokemon-online,代码行数:7,


示例11: pretend_team

static int32_t pretend_team(team_id teamid){    sptr<BProcess> team(new BProcess(teamid));    SLooper::InitMain(team);    SLooper::SetContextObject(team->AsBinder(), B_DEFAULT_CONTEXT);    SLooper::SetContextObject(team->AsBinder(), B_SYSTEM_CONTEXT);    SLooper::Loop();    return 0;}
开发者ID:wenj91,项目名称:OpenBinder,代码行数:9,


示例12: PokeEdit

void TeamMenu::createIndexIfNeeded(int index){    if (index < 6) {        if (!ui->pokemons.contains(index)) {            ui->stack->addWidget(ui->pokemons[index]= new PokeEdit(this, &team().team().poke(index), ui->pokemonModel, ui->itemsModel, ui->natureModel));            ui->pokemons[index]->setProperty("slot", index);            connect(ui->pokemons[index], SIGNAL(numChanged()), SLOT(tabIconChanged()));            connect(ui->pokemons[index], SIGNAL(nameChanged()), SIGNAL(teamChanged()));            connect(ui->pokemons[index], SIGNAL(itemChanged()), SIGNAL(teamChanged()));        }    } else if (index == 6) {        if (!ui->boxes) {            ui->stack->addWidget(ui->boxes = new PokeBoxes(this, &team()));            connect(ui->boxes, SIGNAL(teamChanged()), SLOT(updatePokemons()));            connect(ui->boxes, SIGNAL(teamChanged()), SIGNAL(teamChanged()));        }    }}
开发者ID:Amerac,项目名称:pokemon-online,代码行数:18,


示例13: tr

void TrainerMenu::on_deleteProfile_clicked(){    if(ui->profileList->currentText().isNull()) {        QMessageBox::warning(0, tr("Deleting a Profile"), tr("There's no selected profile to delete."));        return;    }    QSettings s;    QString path = s.value("Profile/Path").toString() + "/" + QUrl::toPercentEncoding(ui->profileList->currentText()) + ".xml";    ui->profileList->removeItem(ui->profileList->currentIndex());    team().profile().deleteProfile(path);}
开发者ID:Airisu,项目名称:pokemon-online,代码行数:11,


示例14: tr

void TrainerMenu::on_colorButton_clicked(){    QColor c = QColorDialog::getColor(team().color());    if (c.green() + c.red() + c.blue() == 0) {        c.setBlue(1);    }    if (!c.isValid())        return;    int luma = (c.green()*3 + c.blue() +c.red()*2)/6;    if ((luma > 140 && c.lightness() > 140) || c.green() > 200) { // So they can click cancel without their colour disappearing!        QMessageBox::information(NULL, tr("Invalid Color"), tr("Your color must have less than 200 parts green, brightness less than 140, and lightness less than 140./n/nYour selected color currently has %1 parts green, a brightness of %2, and a lightness of %3.").arg(c.green()).arg(luma).arg(c.lightness()));        return;    }    team().color() = c;    setColor();}
开发者ID:CrystalMoogle,项目名称:pokemon-online,代码行数:20,


示例15: team

void TeamHolder::save(){    QSettings s;    QStringList locations;    for (int i = 0; i < count(); i++) {        if (team(i).name().isEmpty()) {            QMessageBox::warning(NULL, QObject::tr("Impossible to save team"),                                 QObject::tr("The team number %1 could not be saved as it was given no name!").arg(i+1));        } else {            team(i).saveToFile(team(i).path());            locations.push_back(team(i).path());        }    }    s.setValue("Teams/Locations", locations);    QString path = s.value("Profile/Path").toString() + "/" + QUrl::toPercentEncoding(name()) + ".xml";    profile().saveToFile(path);}
开发者ID:Alicirno,项目名称:pokemon-online,代码行数:20,


示例16: main

int main(){	for( int music, grp; scanf( "%d %d", &music, &grp ) == 2; )	{		std::priority_queue<team> proc;		for( int i = 0, n; i < grp; ++i, --music )		{			scanf( "%d", &n );			proc.push( team( n ) );		}		while( music-- )		{			team t = proc.top();			proc.pop();			proc.push( team( t.people, t.have + 1 ) );		}		printf( "%d/n", proc.top().ratio() );	}}
开发者ID:dibery,项目名称:UVa,代码行数:20,


示例17: team

void TrainerMenu::on_infos_textChanged(){    ui->infoLength->setText(tr("%1/500").arg(ui->infos->toPlainText().length()));    if (ui->infos->toPlainText().length() > 500) {        QString newinfo = ui->infos->toPlainText();        newinfo.chop(ui->infos->toPlainText().length() - 500);        ui->infos->setPlainText(newinfo);        ui->infos->moveCursor(QTextCursor::End,QTextCursor::MoveAnchor);        ui->infoLength->setText(tr("%1/500 (Limit Reached)").arg(ui->infos->toPlainText().length()));    }    team().info().info = ui->infos->toPlainText();}
开发者ID:CrystalMoogle,项目名称:pokemon-online,代码行数:12,


示例18: team

void TrainerTeam::toXml(QDomDocument &document) const{    QDomElement Team = document.createElement("Team");    Team.setAttribute("gen", team().gen());    Team.setAttribute("defaultTier", defaultTier());    Team.setAttribute("version", 1);    document.appendChild(Team);    QDomElement trainer = document.createElement("Trainer");    Team.appendChild(trainer);    QDomText trainerName = document.createTextNode(trainerNick());    trainer.appendChild(trainerName);    trainer.setAttribute("winMsg",trainerWin());    trainer.setAttribute("loseMsg",trainerLose());    trainer.setAttribute("infoMsg",trainerInfo());    trainer.setAttribute("avatar", avatar());    for(int i = 0; i < 6; i++)    {        QDomElement pokemon = document.createElement("Pokemon");        Team.appendChild(team().poke(i).toXml(pokemon));    }}
开发者ID:Antar1011,项目名称:pokemon-online-1.0.53,代码行数:22,


示例19: single_sel_id

w8 g1_human_class::determine_cursor(g1_object_class * object_mouse_is_on){	if (object_mouse_is_on)	{		if (object_mouse_is_on->player_num==team()&&			object_mouse_is_on->get_flag(g1_object_class::SELECTABLE))		{			return G1_SELECT_CURSOR;		}		if (selected_object.valid()&&object_mouse_is_on->id==g1_get_object_type(takeover_pad.get()))		{			return G1_TAKEOVER_CURSOR;		}		if (g1_path_object_class::cast(object_mouse_is_on))		{			return G1_TAKEOVER_CURSOR;		}		if (selected_object.valid()&&selected_object->player_num==team() &&			(selected_object->can_attack(object_mouse_is_on)||			 single_sel_id(selected_object.get())==g1_get_object_type(supergun.get())))		{			return G1_TARGET_CURSOR;		}		return G1_DEFAULT_CURSOR; //nothing selected that can shoot	}	if (selected_object.valid()&&selected_object->player_num==team())	{		if (selected_object->id==g1_get_object_type(supergun.get()))		{			return G1_TARGET_CURSOR;		}		return G1_MOVE_CURSOR;	}	return G1_DEFAULT_CURSOR;}
开发者ID:pgrawehr,项目名称:golgotha,代码行数:37,


示例20: PokeEdit

void TeamMenu::switchToTab(int index){    if (ui->pokemonTabs->currentIndex() != index) {        /* The signal/slot connection will call us again, thus we return */        ui->pokemonTabs->setCurrentIndex(index);        return;    }    if (!ui->pokemons.contains(index)) {        ui->stack->addWidget(ui->pokemons[index]= new PokeEdit(this, &team().team().poke(index), ui->pokemonModel, ui->itemsModel, ui->natureModel));        ui->pokemons[index]->setProperty("slot", index);        connect(ui->pokemons[index], SIGNAL(switchToTrainer()), SIGNAL(switchToTrainer()));        connect(ui->pokemons[index], SIGNAL(numChanged()), SLOT(tabIconChanged()));        connect(ui->pokemons[index], SIGNAL(nameChanged()), SIGNAL(teamChanged()));        connect(ui->pokemons[index], SIGNAL(itemChanged()), SIGNAL(teamChanged()));    }    ui->stack->setCurrentWidget(ui->pokemons[index]);}
开发者ID:CarnegieJames,项目名称:pokemon-online,代码行数:17,


示例21: ss

//! (koshi) don't delete commented things please, they might be need in the future and i'm lazyvoid IBattle::GetBattleFromScript( bool loadmapmod ){	BattleOptions opts;	std::stringstream ss (GetScript());	LSL::TDF::PDataList script( LSL::TDF::ParseTDF(ss) );	LSL::TDF::PDataList replayNode ( script->Find("GAME") );	if ( replayNode.ok() ) {		std::string modname = replayNode->GetString("GameType");		std::string modhash = replayNode->GetString("ModHash");		if ( !modhash.empty() ) modhash = STD_STRING(MakeHashUnsigned(TowxString(modhash)));		SetHostMod( modname, modhash );		//don't have the maphash, what to do?		//ui download function works with mapname if hash is empty, so works for now		std::string mapname    = replayNode->GetString("MapName");		std::string maphash    = replayNode->GetString("MapHash");		if ( !maphash.empty() ) maphash = STD_STRING(MakeHashUnsigned(TowxString(maphash)));		SetHostMap( mapname, maphash );//        opts.ip         = replayNode->GetString( _T("HostIP") );//        opts.port       = replayNode->GetInt  ( _T("HostPort"), DEFAULT_EXTERNAL_UDP_SOURCE_PORT );		opts.spectators = 0;		int playernum = replayNode->GetInt("NumPlayers", 0);		int usersnum = replayNode->GetInt("NumUsers", 0);		if ( usersnum > 0 ) playernum = usersnum;//        int allynum = replayNode->GetInt  ( _T("NumAllyTeams"), 1);//        int teamnum = replayNode->GetInt  ( _T("NumTeams"), 1);		LSL::StringVector sides;		if ( loadmapmod ) {			sides = LSL::usync().GetSides(modname);		}		IBattle::TeamVec parsed_teams = GetParsedTeamsVec();		IBattle::AllyVec parsed_allies = GetParsedAlliesVec();		//[PLAYERX] sections		for ( int i = 0; i < playernum ; ++i ) {			LSL::TDF::PDataList player ( replayNode->Find(stdprintf("PLAYER%d", i)));			LSL::TDF::PDataList bot ( replayNode->Find(stdprintf("AI%d", i )));			if ( player.ok() || bot.ok() ) {				if ( bot.ok() ) player = bot;				User user(player->GetString("Name"), boost::to_upper_copy(player->GetString("CountryCode")), 0);				UserBattleStatus& status = user.BattleStatus();				status.isfromdemo = true;				status.spectator = player->GetInt("Spectator", 0 );				opts.spectators += user.BattleStatus().spectator;				status.team = player->GetInt("Team");				if ( !status.spectator ) {					PlayerJoinedTeam( status.team );				}				status.sync = true;				status.ready = true;				if ( status.spectator ) m_opts.spectators++;				else {					if ( !bot.ok() ) {						if ( status.ready) m_players_ready++;						if ( status.sync ) m_players_sync++;						if ( status.sync && status.ready ) m_players_ok++;					}				}				//! (koshi) changed this from ServerRankContainer to RankContainer				user.Status().rank = (UserStatus::RankContainer)player->GetInt("Rank", -1 );				if ( bot.ok() ) {					status.aishortname = bot->GetString("ShortName");					status.aiversion = bot->GetString("Version");					int ownerindex = bot->GetInt("Host");					LSL::TDF::PDataList aiowner (replayNode->Find(stdprintf("PLAYER%d", ownerindex)));					if ( aiowner.ok() ) {						status.owner = aiowner->GetString("Name");					}				}				IBattle::TeamInfoContainer teaminfos = parsed_teams[user.BattleStatus().team];				if ( !teaminfos.exist ) {					LSL::TDF::PDataList team( replayNode->Find( stdprintf("TEAM%d", user.BattleStatus().team) ));					if ( team.ok() ) {						teaminfos.exist = true;						teaminfos.TeamLeader = team->GetInt("TeamLeader", 0 );						teaminfos.StartPosX = team->GetInt("StartPosX", -1 );						teaminfos.StartPosY = team->GetInt("StartPosY", -1 );						teaminfos.AllyTeam = team->GetInt("AllyTeam", 0 );						teaminfos.RGBColor = GetColorFromFloatStrng(TowxString(team->GetString("RGBColor")));						teaminfos.SideName = team->GetString("Side", "");						teaminfos.Handicap = team->GetInt("Handicap", 0 );						const int sidepos = LSL::Util::IndexInSequence(sides, teaminfos.SideName);						teaminfos.SideNum = sidepos;						parsed_teams[ user.BattleStatus().team ] = teaminfos;					}				}				if ( teaminfos.exist ) {//.........这里部分代码省略.........
开发者ID:cleanrock,项目名称:springlobby,代码行数:101,



注:本文中的team函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ team_index函数代码示例
C++ tdsdump_log函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。