本文整理汇总了C++中setOwner函数的典型用法代码示例。如果您正苦于以下问题:C++ setOwner函数的具体用法?C++ setOwner怎么用?C++ setOwner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOwner函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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());
}
}
示例3: setOwner
void WEXPORT WPopupMenu::attachMenu( WWindow *win, gui_ctl_idx position )
/***********************************************************************/
{
setOwner( win );
attachItem( win, position );
attachChildren( win );
}
示例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.");
}
}
示例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();
}
}
示例6: setOwner
void Component::initialize(const std::shared_ptr<GameObject> &owner, const QVariantMap &arguments)
{
setOwner(owner);
initialize(arguments);
subscribeToMessages();
injectPropertiesInOwner(arguments);
}
示例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;
}
}
示例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();
}
}
}
示例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);
}
}
}
示例10: updatePath
File::File(const File& orig) {
updatePath(orig.path());
setName(orig.getName());
setOwner(orig.getOwner());
setSize(orig.getSize());
setTime(orig.getTime());
}
示例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();
}
示例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();
}
示例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);
}
}
示例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"]);
}
示例15: setOwner
int TTconcept::setOwner(TTconcept *src) {
if (src->_wordP) {
TTword *newWord = src->_wordP->copy();
return setOwner(newWord, 1);
}
return 0;
}