当前位置: 首页>>代码示例>>C++>>正文


C++ CommandList类代码示例

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


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

示例1: decodeBattlefieldParticipants

void SwgSnapshot::decodeBattlefieldParticipants(const NetworkId &objectId, Archive::ReadIterator &data, bool isBaseline)
{
	typedef Archive::AutoDeltaMap<NetworkId, uint32> MapType;
	typedef std::vector<MapType::Command> CommandList;
	CommandList commands;
	if (isBaseline)
		MapType::unpack(data, commands);
	else
		MapType::unpackDelta(data, commands);
	for (CommandList::const_iterator i = commands.begin(); i != commands.end(); ++i)
	{
		switch ((*i).cmd)
		{
			case MapType::Command::ERASE:
				m_battlefieldParticipantBuffer.removeParticipantForRegion(objectId, (*i).key);
				break;

			case MapType::Command::ADD:
			case MapType::Command::SET:
				m_battlefieldParticipantBuffer.setParticipantForRegion(objectId, (*i).key, (*i).value);
				break;

			default:
				FATAL(true,("Unknown AutoDeltaMap command.\n"));
		}
	}
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:27,代码来源:SwgSnapshot.cpp

示例2: decodeExperience

void SwgSnapshot::decodeExperience(const NetworkId &objectId, Archive::ReadIterator &data, bool isBaseline)
{
	typedef Archive::AutoDeltaMap<std::string, int> MapType;
	typedef std::vector<MapType::Command> CommandList;
	CommandList commands;
	if (isBaseline)
		MapType::unpack(data, commands);
	else
		MapType::unpackDelta(data, commands);
	for (CommandList::const_iterator i = commands.begin(); i != commands.end(); ++i)
	{
		switch ((*i).cmd)
		{
			case MapType::Command::ERASE:
				m_experienceBuffer.removeExperience(objectId, (*i).key);
				break;

			case MapType::Command::ADD:
			case MapType::Command::SET:
				m_experienceBuffer.setExperience(objectId, (*i).key, (*i).value);
				break;

			default:
				FATAL(true,("Unknown AutoDeltaMap command.\n"));
		}
	}
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:27,代码来源:SwgSnapshot.cpp

示例3: decodeManufactureSchematicAttributes

void SwgSnapshot::decodeManufactureSchematicAttributes(const NetworkId &objectId, Archive::ReadIterator &data, bool isBaseline)
{
	typedef Archive::AutoDeltaMap<StringId, float> MapType;
	typedef std::vector<MapType::Command> CommandList;
	CommandList commands;
	if (isBaseline)
		MapType::unpack(data, commands);
	else
		MapType::unpackDelta(data, commands);
	for (CommandList::const_iterator i = commands.begin(); i != commands.end(); ++i)
	{
		switch ((*i).cmd)
		{
			case MapType::Command::ERASE:
				m_manufactureSchematicAttributeBuffer.removeManufactureSchematicAttribute(objectId,(*i).key.getCanonicalRepresentation());
				break;

			case MapType::Command::ADD:
			case MapType::Command::SET:
				m_manufactureSchematicAttributeBuffer.setManufactureSchematicAttribute(objectId,(*i).key.getCanonicalRepresentation(),(*i).value);
				break;

			default:
				FATAL(true,("Unknown AutoDeltaMap command.\n"));
		}
	}
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:27,代码来源:SwgSnapshot.cpp

示例4: decodePropertyList

void SwgSnapshot::decodePropertyList(const NetworkId &objectId, int listId, Archive::ReadIterator &data, bool isBaseline)
{
	typedef Archive::AutoDeltaSet<std::string> SetType;
	typedef std::vector<SetType::Command> CommandList;
	CommandList commands;
	if (isBaseline)
		SetType::unpack(data, commands);
	else
		SetType::unpackDelta(data, commands);
	for (CommandList::const_iterator i = commands.begin(); i != commands.end(); ++i)
	{
		switch (i->cmd)
		{
			case SetType::Command::ERASE:
				m_propertyListBuffer.deleteProperty(objectId, listId, i->value);
				break;
			case SetType::Command::INSERT:
				m_propertyListBuffer.insertProperty(objectId, listId, i->value);
				break;
			case SetType::Command::CLEAR:
				m_propertyListBuffer.clearProperties(objectId, listId);
				break;
			default:
				FATAL(true,("Unknown AutoDeltaSet command.\n"));
		}
	}
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:27,代码来源:SwgSnapshot.cpp

示例5: native_TSC_SendClientMessage

//native TSC_SendClientMessage(uid[], msg[]);
cell AMX_NATIVE_CALL native_TSC_SendClientMessage(AMX* amx, cell* params) {
	char *TmpParam = NULL;

	amx_StrParam(amx, params[1], TmpParam);
	string UID(TmpParam);
	TSServer.EscapeString(UID);

	amx_StrParam(amx, params[2], TmpParam);
	string Msg(TmpParam);
	TSServer.EscapeString(Msg);


	CommandList *cmds = new CommandList;

	CCommand *cmd1 = new CCommand("clientlist -uid", "clid");
	cmd1->MFind = "client_unique_identifier=";
	cmd1->MFind.append(UID);
	cmds->push(cmd1);

	char FormatTmp[256];
	sprintf(FormatTmp, "sendtextmessage targetmode=1 target=<1> msg=%s", Msg.c_str());
	cmds->push(new CCommand(FormatTmp, "cid"));

	TSServer.AddCommandListToQueue(cmds);
	return 1;
}
开发者ID:hqy,项目名称:tsconnector,代码行数:27,代码来源:natives.cpp

示例6: Q_UNUSED

void ScaleInteraction::snapMouseReleaseEvent(QMouseEvent * anEvent, Feature* /*Closer*/)
{
    Q_UNUSED(anEvent);

    if (Radius != 1.0 && Scaling.size() && !panning())
    {
        CommandList* theList;
        theList = new CommandList(MainWindow::tr("Scale Feature").arg(Scaling[0]->id().numId), Scaling[0]);
        for (int i=0; i<Scaling.size(); ++i)
        {
            if (NodeOrigin && Scaling[i] == OriginNode)
                continue;
            Scaling[i]->setPosition(OriginalPosition[i]);
            if (Scaling[i]->layer()->isTrack())
                theList->add(new MoveNodeCommand(Scaling[i],scalePosition(OriginalPosition[i], Radius), Scaling[i]->layer()));
            else
                theList->add(new MoveNodeCommand(Scaling[i],scalePosition(OriginalPosition[i], Radius), document()->getDirtyOrOriginLayer(Scaling[i]->layer())));
        }


        document()->addHistory(theList);
        view()->invalidate(true, true, false);
    }
    view()->setInteracting(false);
    Radius = 1.0;
    Scaling.clear();
    OriginalPosition.clear();
    clearNoSnap();
}
开发者ID:Harpalus,项目名称:merkaartor,代码行数:29,代码来源:ScaleInteraction.cpp

示例7: native_TSC_MoveChannelBelowChannel

//native TSC_MoveChannelBelowChannel(channelname[], parentchannelname[]);
cell AMX_NATIVE_CALL native_TSC_MoveChannelBelowChannel(AMX* amx, cell* params) {
	char *TmpParam = NULL;

	amx_StrParam(amx, params[1], TmpParam);
	string ChannelName(TmpParam);
	TSServer.EscapeString(ChannelName);

	amx_StrParam(amx, params[2], TmpParam);
	string ParentChannelName(TmpParam);
	TSServer.EscapeString(ParentChannelName);

	
	CommandList *cmds = new CommandList;

	string CmdStr("channelfind pattern=");
	CmdStr.append(ChannelName);
	cmds->push(new CCommand(CmdStr, "cid"));

	CmdStr.assign("channelfind pattern=");
	CmdStr.append(ParentChannelName);
	cmds->push(new CCommand(CmdStr, "cid"));

	cmds->push(new CCommand("channeledit cid=<1> channel_order=<2>"));

	TSServer.AddCommandListToQueue(cmds);
	return 1;
}
开发者ID:hqy,项目名称:tsconnector,代码行数:28,代码来源:natives.cpp

示例8: native_TSC_MoveClient

//native TSC_MoveClient(uid[], channelname[]);
cell AMX_NATIVE_CALL native_TSC_MoveClient(AMX* amx, cell* params) {
	char *TmpParam = NULL;

	amx_StrParam(amx, params[1], TmpParam);
	string UID(TmpParam);
	TSServer.EscapeString(UID);

	amx_StrParam(amx, params[2], TmpParam);
	string ChannelName(TmpParam);
	TSServer.EscapeString(ChannelName);
	

	CommandList *cmds = new CommandList;
	
	CCommand *cmd1 = new CCommand("clientlist -uid", "clid");
	cmd1->MFind = "client_unique_identifier=";
	cmd1->MFind.append(UID);
	cmds->push(cmd1);

	char FormatTmp[128];
	sprintf(FormatTmp, "channelfind pattern=%s", ChannelName.c_str());
	cmds->push(new CCommand(FormatTmp, "cid"));

	cmds->push(new CCommand("clientmove clid=<1> cid=<2>"));

	TSServer.AddCommandListToQueue(cmds);
	return 1;
}
开发者ID:hqy,项目名称:tsconnector,代码行数:29,代码来源:natives.cpp

示例9: native_TSC_SetClientChannelGroup

//native TSC_SetClientChannelGroup(uid[], groupid, channelname[]);
cell AMX_NATIVE_CALL native_TSC_SetClientChannelGroup(AMX* amx, cell* params) {
	char *TmpParam = NULL;

	amx_StrParam(amx, params[1], TmpParam);
	string UID(TmpParam);
	TSServer.EscapeString(UID);

	amx_StrParam(amx, params[3], TmpParam);
	string ChannelName(TmpParam);
	TSServer.EscapeString(ChannelName);
	
	
	CommandList *cmds = new CommandList;

	string CmdStr("channelfind pattern=");
	CmdStr.append(ChannelName);
	cmds->push(new CCommand(CmdStr, "cid"));

	char FormatTmp[256];
	sprintf(FormatTmp, "clientdbfind pattern=%s -uid", UID.c_str());
	cmds->push(new CCommand(FormatTmp, "cldbid"));

	sprintf(FormatTmp, "setclientchannelgroup cgid=%d cid=<1> cldbid=<2>", (int)params[2]);
	cmds->push(new CCommand(FormatTmp));

	TSServer.AddCommandListToQueue(cmds);
	return 1;
}
开发者ID:hqy,项目名称:tsconnector,代码行数:29,代码来源:natives.cpp

示例10: native_TSC_SetChannelDescription

//native TSC_SetChannelDescription(channelname[], desc[]);
cell AMX_NATIVE_CALL native_TSC_SetChannelDescription(AMX* amx, cell* params) {
	char *TmpParam = NULL;

	amx_StrParam(amx, params[1], TmpParam);
	string ChannelName(TmpParam);
	TSServer.EscapeString(ChannelName);

	amx_StrParam(amx, params[2], TmpParam);
	string Desc(TmpParam);
	TSServer.EscapeString(Desc);


	CommandList *cmds = new CommandList;

	string CmdStr("channelfind pattern=");
	CmdStr.append(ChannelName);
	cmds->push(new CCommand(CmdStr, "cid"));

	CmdStr.assign("channeledit cid=<1> channel_description=");
	CmdStr.append(Desc);
	cmds->push(new CCommand(CmdStr));

	TSServer.AddCommandListToQueue(cmds);
	return 1;
}
开发者ID:hqy,项目名称:tsconnector,代码行数:26,代码来源:natives.cpp

示例11: foreach

void PropertiesDock::on_RemoveMemberButton_clicked()
{
    if (CurrentMembersView)
    {
        Relation* R = dynamic_cast<Relation*>(Selection[0]);
        if (R) {
            QModelIndexList indexes = CurrentMembersView->selectionModel()->selectedIndexes();
            QModelIndex index;

            foreach(index, indexes)
            {
                QModelIndex idx = index.sibling(index.row(),0);
                QVariant Content(R->referenceMemberModel(Main)->data(idx,Qt::UserRole));
                if (Content.isValid())
                {
                    Feature* F = Content.value<Feature*>();
                    if (F) {
                        CommandList* L = new CommandList(MainWindow::tr("Remove member '%1' on %2").arg(F->description()).arg(R->description()), R);
                        if (R->find(F) < R->size())
                            L->add(new RelationRemoveFeatureCommand(R,F,Main->document()->getDirtyOrOriginLayer(R->layer())));
                        if (L->empty())
                            delete L;
                        else
                        {
                            Main->document()->addHistory(L);
                            Main->invalidateView();
                            return;
                        }
                    }
                }
            }
        }
    }
开发者ID:liuzhidan,项目名称:merkaartor,代码行数:33,代码来源:PropertiesDock.cpp

示例12: native_TSC_SendChannelMessage

//native TSC_SendChannelMessage(channelname[], msg[]);
cell AMX_NATIVE_CALL native_TSC_SendChannelMessage(AMX* amx, cell* params) {
	char *TmpParam = NULL;

	amx_StrParam(amx, params[1], TmpParam);
	string ChannelName(TmpParam);
	TSServer.EscapeString(ChannelName);

	amx_StrParam(amx, params[2], TmpParam);
	string Msg(TmpParam);
	TSServer.EscapeString(Msg);


	CommandList *cmds = new CommandList;

	string CmdStr("channelfind pattern=");
	CmdStr.append(ChannelName);
	cmds->push(new CCommand(CmdStr, "cid"));

	char FormatTmp[256];
	sprintf(FormatTmp, "sendtextmessage targetmode=2 target=<1> msg=%s", Msg.c_str());
	cmds->push(new CCommand(FormatTmp));

	TSServer.AddCommandListToQueue(cmds);
	return 1;
}
开发者ID:hqy,项目名称:tsconnector,代码行数:26,代码来源:natives.cpp

示例13: Q_UNUSED

void RotateInteraction::snapMouseReleaseEvent(QMouseEvent * anEvent, Feature* /*Closer*/)
{
    Q_UNUSED(anEvent);

    if (Angle != 0.0 && Rotating.size() && !panning())
    {
        CommandList* theList;
        theList = new CommandList(MainWindow::tr("Rotate Feature").arg(Rotating[0]->id().numId), Rotating[0]);
        for (int i=0; i<Rotating.size(); ++i)
        {
            if (NodeOrigin && Rotating[i] == OriginNode)
                continue;
            Rotating[i]->setPosition(OriginalPosition[i]);
            if (Rotating[i]->layer()->isTrack())
                theList->add(new MoveNodeCommand(Rotating[i],rotatePosition(OriginalPosition[i], Angle), Rotating[i]->layer()));
            else
                theList->add(new MoveNodeCommand(Rotating[i],rotatePosition(OriginalPosition[i], Angle), document()->getDirtyOrOriginLayer(Rotating[i]->layer())));
        }


        document()->addHistory(theList);
        view()->invalidate(true, false);
    }
    Angle = 0.0;
    Rotating.clear();
    OriginalPosition.clear();
    clearNoSnap();
}
开发者ID:4x4falcon,项目名称:fosm-merkaartor,代码行数:28,代码来源:RotateInteraction.cpp

示例14: switch

void PropertiesDock::on_RemoveTagButton_clicked()
{
    QTableView* TagTable = 0;
    switch (NowShowing)
    {
    case TrackPointUiShowing:
        TagTable = TrackPointUi.TagView; break;
    case RoadUiShowing:
        TagTable = RoadUi.TagView; break;
    case MultiShowing:
        TagTable = MultiUi.TagView; break;
    case RelationUiShowing:
        TagTable = RelationUi.TagView; break;
    default: break;
    }
    if (!TagTable) return;

    QModelIndexList indexes = TagTable->selectionModel()->selectedIndexes();
    if (indexes.isEmpty()) return;

    CommandList *L = 0;
    if (indexes.count()==1)
    {
        QModelIndex index = indexes.at(0);
        QModelIndex idx = index.sibling(index.row(),0);
        QVariant Content(theModel->data(idx,Qt::DisplayRole));
        if (Content.isValid())
        {
            QString KeyName = Content.toString();
            L = new CommandList(MainWindow::tr("Clear Tag '%1' on %2").arg(KeyName).arg(Selection[0]->id().numId), Selection[0]);
            for (int i=0; i<Selection.size(); ++i)
                if (Selection[i]->findKey(KeyName) != -1)
                    L->add(new ClearTagCommand(Selection[i],KeyName,Main->document()->getDirtyOrOriginLayer(Selection[i]->layer())));
        }
    }
    else
    {
        L = new CommandList(MainWindow::tr("Clear %1 tags on %2").arg(indexes.count()).arg(Selection[0]->id().numId), Selection[0]);
        while (!indexes.isEmpty()) {
            QModelIndex index = indexes.takeLast();
            QModelIndex idx = index.sibling(index.row(),0);
            QVariant Content(theModel->data(idx,Qt::DisplayRole));
            if (Content.isValid())
            {
                QString KeyName = Content.toString();
                for (int i=0; i<Selection.size(); ++i)
                    if (Selection[i]->findKey(KeyName) != -1)
                        L->add(new ClearTagCommand(Selection[i],KeyName,Main->document()->getDirtyOrOriginLayer(Selection[i]->layer())));
            }
        }
    }
    if (!L) return;
    if (L->empty()) {
        delete L;
    } else {
        Main->document()->addHistory(L);
        Main->invalidateView();
    }
}
开发者ID:liuzhidan,项目名称:merkaartor,代码行数:59,代码来源:PropertiesDock.cpp

示例15: findInCommands

static inline bool
findInCommands( const CommandList& l, const QString& needle )
{
    for ( CommandList::const_iterator i = l.cbegin(); i != l.cend(); ++i )
        if ( i->command().contains( needle ) )
            return true;
    return false;
}
开发者ID:calamares,项目名称:calamares,代码行数:8,代码来源:CommandList.cpp


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