• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ setOwner函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: isOwner

/**
 * Detaches shallow copies and creates deep copies of all subentities.
 * This is called after cloning entity containers.
 */
void RS_EntityContainer::detach() {
    QList<RS_Entity*> tmp;
    bool autoDel = isOwner();
	RS_DEBUG->print("RS_EntityContainer::detach: autoDel: %d", 
		(int)autoDel);
    setOwner(false);

    // make deep copies of all entities:
    for (RS_Entity* e=firstEntity();
            e!=NULL;
            e=nextEntity()) {
        if (!e->getFlag(RS2::FlagTemp)) {
            tmp.append(e->clone());
        }
    }

    // clear shared pointers:
    entities.clear();
    setOwner(autoDel);

    // point to new deep copies:
    for (int i = 0; i < tmp.size(); ++i) {
        RS_Entity* e = tmp.at(i);
        entities.append(e);
        e->reparent(this);
    }
}
开发者ID:Samsagax,项目名称:LibreCAD,代码行数:31,代码来源:rs_entitycontainer.cpp


示例2: setGroup

void NetworkManager::TunSetting::fromMap(const QVariantMap &setting)
{
    if (setting.contains(QLatin1String(NM_SETTING_TUN_GROUP))) {
        setGroup(setting.value(QLatin1String(NM_SETTING_TUN_GROUP)).toString());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_MODE))) {
        setMode((Mode)setting.value(QLatin1String(NM_SETTING_TUN_MODE)).toUInt());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_MULTI_QUEUE))) {
        setMultiQueue(setting.value(QLatin1String(NM_SETTING_TUN_MULTI_QUEUE)).toBool());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_OWNER))) {
        setOwner(setting.value(QLatin1String(NM_SETTING_TUN_OWNER)).toString());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_PI))) {
        setPi(setting.value(QLatin1String(NM_SETTING_TUN_PI)).toBool());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_VNET_HDR))) {
        setVnetHdr(setting.value(QLatin1String(NM_SETTING_TUN_VNET_HDR)).toBool());
    }
}
开发者ID:KDE,项目名称:networkmanager-qt,代码行数:26,代码来源:tunsetting.cpp


示例3: setOwner

void WEXPORT WPopupMenu::attachMenu( WWindow *win, gui_ctl_idx position )
/***********************************************************************/
{
    setOwner( win );
    attachItem( win, position );
    attachChildren( win );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:7,代码来源:wpopmenu.cpp


示例4: setOwner

void LightsaberCrystalComponentImplementation::tuneCrystal(CreatureObject* player) {

	if(!player->hasSkill("force_title_jedi_rank_01") || !hasPlayerAsParent(player)) {
		return;
	}

	if ((owner == "")){
		String name = player->getDisplayedName();
		setOwner(name);

		// Color code is lime green.
		String tuneName;
		if (getCustomObjectName().toString().contains("(Exceptional)"))
			tuneName = "\\#00FF00" + postTuneName + " (Exceptional) (tuned)";
		else if (getCustomObjectName().toString().contains("(Legendary)"))
			tuneName = "\\#00FF00" + postTuneName + " (Legendary) (tuned)";
		else
			tuneName = "\\#00FF00" + postTuneName + " (tuned)";

		setCustomObjectName(tuneName, true);
		player->sendSystemMessage("@jedi_spam:crystal_tune_success");
	} else {
		player->sendSystemMessage("This crystal has already been tuned.");
	}
}
开发者ID:Nifdoolb,项目名称:Server,代码行数:25,代码来源:LightsaberCrystalComponentImplementation.cpp


示例5: m_quiet

ThresholdDetectorRuntimeBox::ThresholdDetectorRuntimeBox(const ThresholdDetectorBox *box) :
    m_quiet(box->quiet())
{
    setOwner(box);

    InputPorts in = box->inputPorts();
    m_threshold.init(this, in[0], toPortNotifier(&ThresholdDetectorRuntimeBox::setThreshold));
    m_in.init(this, in[1], toPortNotifier(&ThresholdDetectorRuntimeBox::processData));
    setInputPorts(RuntimeInputPorts() << &m_threshold << &m_in);

    OutputPorts out = box->outputPorts();
    m_out.init(this, out[0]);
    setOutputPorts(RuntimeOutputPorts() << &m_out);

    Q_ASSERT(in[0]->format().dataSize() == 1);
    Q_ASSERT(in[1]->format().dataSize() == 1);
    Q_ASSERT(out[0]->format().dataSize() == 1);

    switch (box->param()) {
    case ThresholdLess:   m_thresholdFunc = &ThresholdDetectorRuntimeBox::thresholdLess;   break;
    case ThresholdLessOrEqual:   m_thresholdFunc = &ThresholdDetectorRuntimeBox::thresholdLessOrEqual;   break;
    case ThresholdGreater:   m_thresholdFunc = &ThresholdDetectorRuntimeBox::thresholdGreater;   break;
    case ThresholdGreaterOrEqual:   m_thresholdFunc = &ThresholdDetectorRuntimeBox::thresholdGreaterOrEqual;   break;
    case ThresholdEqual:   m_thresholdFunc = &ThresholdDetectorRuntimeBox::thresholdEqual;   break;
    case ThresholdNotEqual:   m_thresholdFunc = &ThresholdDetectorRuntimeBox::thresholdNotEqual;   break;
    default:
        throwBoxException("Invalid threshold parameter");
    }
    if (in[0]->link())
        m_thresholdDataValid = false;
    else {
        m_thresholdDataValid = true;
        m_thresholdData = box->thresholdValue();
    }
}
开发者ID:deadmorous,项目名称:equares,代码行数:35,代码来源:ThresholdDetectorBox.cpp


示例6: setOwner

void Component::initialize(const std::shared_ptr<GameObject> &owner, const QVariantMap &arguments)
{
    setOwner(owner);
    initialize(arguments);
    subscribeToMessages();
    injectPropertiesInOwner(arguments);
}
开发者ID:surjikal,项目名称:cbgos-experiment,代码行数:7,代码来源:component.cpp


示例7: setOwner

ConstraintTag::ConstraintTag(Object *owner, QByteArray* data)
{
    setOwner(owner);
    if (data == 0) {
        _positionMode = Mode::ignore;
        _rotationMode = Mode::ignore;
        _scalationMode = Mode::ignore;
        _hasPosId = false;
        _hasRotId = false;
        _hasScaleId = false;
        _affectX = true;
        _affectY = true;
    } else {
        QDataStream stream(data, QIODevice::ReadOnly);
        QString className;
        quint8 posMode, affectX, affectY, hasPosId, rotMode, hasRotId, scaleMode, hasScaleId;
        quint64 posId, rotId, scaleId;
        stream >> className
               >> posMode >> affectX >> affectY >> hasPosId >> posId
               >> rotMode >> hasRotId >> rotId
               >> scaleMode >> hasScaleId >> scaleId;
        Q_ASSERT(className == type());
        _positionMode = (Mode) posMode;
        _rotationMode = (Mode) rotMode;
        _scalationMode = (Mode) scaleMode;
        _hasPosId = (bool) hasPosId;
        _posId = posId;
        _hasRotId = (bool) hasRotId;
        _rotId = rotId;
        _hasScaleId = (bool) hasScaleId;
        _scaleId = scaleId;
        _affectX = (bool) affectX;
        _affectY = (bool) affectY;
    }
}
开发者ID:oVooVo,项目名称:freezing-happiness,代码行数:35,代码来源:constrainttag.cpp


示例8: setOwner

void cNPC::postload( unsigned int version )
{
	if ( stablemasterSerial_ != INVALID_SERIAL )
	{
		pos_.setInternalMap();
	}

	cBaseChar::postload( version );

	if(ownerSerial_ != INVALID_SERIAL)
		setOwner(dynamic_cast<P_PLAYER>(World::instance()->findChar(ownerSerial_)));

	if ( wanderType() == enFollowTarget )
		setWanderType( enFreely );

	if ( stablemasterSerial() == INVALID_SERIAL && !pos_.isInternalMap() )
	{
		MapObjects::instance()->add( this );
	}

	// If our stablemaster is missing, remove us
	if ( stablemasterSerial_ != INVALID_SERIAL )
	{
		cUObject *stablemaster = World::instance()->findObject( stablemasterSerial_ );
		if ( !stablemaster )
		{
			Console::instance()->log( LOG_WARNING, tr( "Removing NPC %1 (0x%2) because of invalid stablemaster 0x%3.\n" ).arg( name() ).arg( serial_, 0, 16 ).arg( stablemasterSerial_, 0, 16 ) );
			stablemasterSerial_ = INVALID_SERIAL;
			remove();
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:32,代码来源:npc.cpp


示例9: setRessources

void NodeCombat::incoming(Squad s)
{
    const Gamer &g = s.getOwner();
    int ressource = s.getNbRessources();

    if(&g == owner)
    {
        //Entrée d'allier
        setRessources(nbRessources+ressource);
    }
    else
    {
        //Entrée d'ennemis
        if(invicible) ressource = 0;
        ressource = dealDamageOnArmor(ressource);
        if (nbRessources < ressource)
        {
            //Changement de propriétaire
            ressource -= nbRessources;
            setRessources(ressource);
            setOwner(&g);
        }
        else
        {
            setRessources(nbRessources-ressource);
        }
    }
}
开发者ID:LukasBitter,项目名称:P2,代码行数:28,代码来源:nodecombat.cpp


示例10: updatePath

File::File(const File& orig) {
    updatePath(orig.path());
    setName(orig.getName());
    setOwner(orig.getOwner());
    setSize(orig.getSize());
    setTime(orig.getTime());
}
开发者ID:hmenn,项目名称:GTU-2015-CSE241-OOP-HW,代码行数:7,代码来源:File.cpp


示例11: unbindControls

	void DynamicVehicle::exit()
	{
		unbindControls();
		if (entrycam.valid()) {
			entrycam->setPosition( getWorldTransformMatrix().getTrans() + getWorldTransformMatrix().getRotate() * entrypos);
			entrycam->track(NULL);
			entrycam->pointAt(this);
			entrycam->activate();
		} else
			CameraManipulator::instance().setNoActiveCamera();
		if (trackcam.valid())
			trackcam->track(NULL);
		if (Scenario::current())
			Scenario::current()->removeComponent(trackcam.get());
		// Export current vehicle to Lua interpreter
		Interpreter::instance().pushGlobal("objects");
		Interpreter::instance().setTable("vehicle", NULL, "nil");
		// Set model visbility interior/extiror
		setModelVisibilityWithTag("interior", false);
		setModelVisibilityWithTag("exterior", true);

		setOwner(NULL);
		
		Vehicle::exit();
	}
开发者ID:minsulander,项目名称:moon,代码行数:25,代码来源:DynamicVehicle.cpp


示例12: dout

	void DynamicVehicle::enter()
	{
		if (!drivercam.valid()) {
			drivercam = dynamic_cast<Camera*> (findRelatedByTag("driver"));
			if (!drivercam.valid()) {
				dout(ERROR) << "No driver camera found in vehicle '" << getName() << "'\n";
				return;
			}
		}
		entrycam = CameraManipulator::instance().getActiveCamera();
		if (entrycam.valid())
			entrypos = osg::Matrix::inverse(getWorldTransformMatrix()).getRotate() * (entrycam->getWorldTransformMatrix().getTrans() - getWorldTransformMatrix().getTrans());
		drivercam->activate();
		
		if (!exitControl.valid())
			exitControl = new ListenerControl("Exit", Control::MOMENTARY, this);
		if (!cameraModeControl.valid())
			cameraModeControl = new ListenerControl("CameraMode", Control::MOMENTARY, this);
		bindControls();
		if (isRemote() && getOwner())
			dout(WARN) << "Entered remote vehicle " << getName() << " owned by " << (getOwner() ? getOwner()->toString() : "server") << "\n";
		setOwner(moonet::Client::me());
		// Export current vehicle to Lua interpreter
		Interpreter::instance().pushGlobal("objects");
		Interpreter::instance().setTable("vehicle", this, "moon::KinematicObject");
		// Set model visbility interior/extiror
		setModelVisibilityWithTag("interior", true);
		setModelVisibilityWithTag("exterior", false);

		Vehicle::enter();
	}
开发者ID:minsulander,项目名称:moon,代码行数:31,代码来源:DynamicVehicle.cpp


示例13: setOwner

void QUrlInfo_QtDShell::__override_setOwner(const QString&  s0, bool static_call)
{
    if (static_call) {
        QUrlInfo::setOwner((const QString& )s0);
    } else {
        setOwner((const QString& )s0);
    }
}
开发者ID:dreamsxin,项目名称:nawia,代码行数:8,代码来源:QUrlInfo_shell.cpp


示例14: qDebug

void MainWindow::updateOwner()
{
    qDebug() << add->record["OPERATOR"] << data->operatorstr;
    setOwner(add->record["OPERATOR"]);
    setQTH(add->record["HOME_QTH"]);
    setGrid(add->record["HOME_GRID"]);
    setStation(add->record["STATION_CALL"]);
}
开发者ID:compeoree,项目名称:QtSDR,代码行数:8,代码来源:mainwindow.cpp


示例15: setOwner

int TTconcept::setOwner(TTconcept *src) {
	if (src->_wordP) {
		TTword *newWord = src->_wordP->copy();
		return setOwner(newWord, 1);
	}

	return 0;
}
开发者ID:OmerMor,项目名称:scummvm,代码行数:8,代码来源:tt_concept.cpp


示例16: query

/*!
 * \brief Load the definition of the given schema
 * \return true - If the loading succeeded
 * \return false - Otherwise
 */
bool
Schema::loadData()
{
    if (mIsLoaded) {
        return true;
    }

    QSqlDatabase db = QSqlDatabase::database("mainConnect");
    QSqlQuery query(db);
    QString qstr;

    qstr = QString("SELECT "
//                       "nspname AS name, "
                       "roles.rolname AS ownername, "
                       "description "
                   "FROM "
                       "pg_catalog.pg_namespace pgn "
                       "LEFT JOIN pg_roles roles ON roles.oid = pgn.nspowner "
                       "LEFT JOIN pg_description descr ON descr.objoid = pgn.oid "
                   "WHERE "
                       "nspname = '%1';")
        .arg(mName);

#ifdef DEBUG_QUERY
    qDebug() << "Psql::Role::loadData> " << qstr;
#endif

    // if query failed
    if (!query.exec(qstr)) {
        qDebug() << query.lastError().text();
        return false;
    }

    // if query didn't retrieve a row
    if (!query.first()) {
        return false;
    }

    // get data from query
    int colId = 0;
    colId = query.record().indexOf("ownername");
    QString ownerName = query.value(colId).toString();

    colId = query.record().indexOf("description");
    QString description = query.value(colId).toString();

    // find owner for scheme
    DbRolePtr dbRole = Common::Database::instance()->findRole(ownerName);
//    Q_CHECK_PTR(dbRole);

    setOwner(dbRole);

    // set scheme description
    setDescription(description);

    return DbSchema::loadData();
}
开发者ID:Ascent-Group,项目名称:visual-db,代码行数:62,代码来源:Schema.cpp


示例17: setOwner

void
Monitor::unlock() {
  setOwner(NULL);
  if (InterlockedDecrement(&_lock_count) >= 0) {
    // Wake a waiting thread up
    DWORD dwRet = SetEvent(_lock_event);
    assert(dwRet != 0); // Unexpected return value from SetEvent
  }
}
开发者ID:tetratec,项目名称:Runescape-Launcher,代码行数:9,代码来源:Monitor.cpp


示例18: BcAssertMsg

//////////////////////////////////////////////////////////////////////////
// preInitialise
void CsResource::preInitialise( const BcName& Name, BcU32 Index, CsPackage* pPackage )
{
	BcAssertMsg( Name != BcName::INVALID, "Resource can not have an invalid name." );
	BcAssertMsg( Name != BcName::NONE, "Resource can not have a none name." );

	setName( Name );
	setOwner( pPackage );
	Index_ = Index;
}
开发者ID:Dezzles,项目名称:Psybrus,代码行数:11,代码来源:CsResource.cpp


示例19: WorldObject

Unit::Unit(const Unit& newUnit)
	: WorldObject(newUnit), 
	hp(newUnit.hp), cost(newUnit.cost), attackDamage(newUnit.attackDamage), speed(newUnit.speed),
	munch_speed(newUnit.munch_speed), range(newUnit.range), sight(newUnit.sight),
	spread_speed(newUnit.spread_speed), spread_radius(newUnit.spread_radius),
	scale(newUnit.scale), target(NULL), curFrame(0), numFrames(newUnit.numFrames), spriteSize(newUnit.spriteSize),
	navTarget(CIwFVec2(0, 0)), repulsion_factor(1)
{
	setOwner(newUnit.owner);
}
开发者ID:jruberg,项目名称:COMP419,代码行数:10,代码来源:unit.cpp


示例20: setOwner

bool House::executeTransfer(HouseTransferItem* item, Player* newOwner)
{
	if (transferItem != item) {
		return false;
	}

	setOwner(newOwner->getGUID());
	transferItem = nullptr;
	return true;
}
开发者ID:HeavenIsLost,项目名称:ChronusServer,代码行数:10,代码来源:house.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setPCode函数代码示例发布时间:2022-05-30
下一篇:
C++ setOutputStreamSRI函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap