コード例 #1
0
void SGFACESET::unlinkRefNode( const SGNODE* aNode )
{
    unlinkNode( aNode, false );
    return;
}
コード例 #2
0
void SGSHAPE::unlinkRefNode( const SGNODE* aNode )
{
    unlinkNode( aNode, false );
    return;
}
コード例 #3
0
void SGFACESET::unlinkChildNode( const SGNODE* aNode )
{
    unlinkNode( aNode, true );
    return;
}
コード例 #4
0
void SGSHAPE::unlinkChildNode( const SGNODE* aNode )
{
    unlinkNode( aNode, true );
    return;
}
コード例 #5
0
void SCENEGRAPH::unlinkRefNode( const SGNODE* aNode )
{
    unlinkNode( aNode, false );
    return;
}
コード例 #6
0
void SCENEGRAPH::unlinkChildNode( const SGNODE* aNode )
{
    unlinkNode( aNode, true );
    return;
}
コード例 #7
0
ファイル: Main.cpp プロジェクト: diafero/PlasmaShop
/* VaultShopMain */
VaultShopMain::VaultShopMain()
{
    // Basic Form Settings
    setWindowTitle("VaultShop " PLASMASHOP_VERSION);
    //setWindowIcon(QIcon(":/res/VaultShop.png"));

    // Set up actions
    fActions[kFileOpenVault] = new QAction(qStdIcon("document-open"), tr("&Load Vault..."), this);
    fActions[kFileSaveVault] = new QAction(qStdIcon("document-save"), tr("&Save Vault"), this);
    fActions[kFileExit] = new QAction(tr("E&xit"), this);
    fActions[kVaultOpenNode] = new QAction(tr("Subscribe to &Node..."), this);

    fActions[kNodeUnLink] = new QAction(tr("Remove"), this);
    fActions[kNodeLink] = new QAction(tr("Add Node..."), this);
    fActions[kNodeCreate] = new QAction(tr("Create Node"), this);
    fActions[kNodeUnsubscribe] = new QAction(tr("Un-subscribe"), this);
    //fActions[kNodeRenameVault] = new QAction(tr("Rename Vault..."), this);

    fActions[kFileOpenVault]->setShortcut(Qt::CTRL + Qt::Key_O);
    fActions[kFileSaveVault]->setShortcut(Qt::CTRL + Qt::Key_S);
    fActions[kFileExit]->setShortcut(Qt::ALT + Qt::Key_F4);
    fActions[kVaultOpenNode]->setShortcut(Qt::Key_F2);

    // Main Menus
    QMenu* fileMenu = menuBar()->addMenu(tr("&File"));
    fileMenu->addAction(fActions[kFileOpenVault]);
    fileMenu->addAction(fActions[kFileSaveVault]);
    fileMenu->addSeparator();
    fileMenu->addAction(fActions[kFileExit]);

    QMenu* vaultMenu = menuBar()->addMenu(tr("&Vault"));
    vaultMenu->addAction(fActions[kVaultOpenNode]);

    // Toolbars
    QToolBar* fileTbar = addToolBar(tr("File Toolbar"));
    fileTbar->setObjectName("FileToolBar");
    fileTbar->addAction(fActions[kFileOpenVault]);
    fileTbar->addAction(fActions[kFileSaveVault]);
    statusBar();

    // Main Splitter
    QSplitter* splitter = new QSplitter(Qt::Horizontal, this);
    splitter->setObjectName("Splitter");

    // Node Browser
    fVaultTree = new QTreeWidget(splitter);
    fVaultTree->setUniformRowHeights(true);
    fVaultTree->setHeaderHidden(true);
    fVaultTree->setContextMenuPolicy(Qt::CustomContextMenu);

    // Property Editor
    fNodeTab = new QTabWidget(splitter);
    fGenericEditor = new QVaultNode(fNodeTab);
    fNodeTab->addTab(fGenericEditor, tr("Node Properties"));
    fCustomEditor = NULL;
    fSavEditor = NULL;
    fEditorTabPreference = 0;

    // Layout
    splitter->addWidget(fVaultTree);
    splitter->addWidget(fNodeTab);
    setCentralWidget(splitter);
    splitter->setSizes(QList<int>() << 160 << 320);

    // Global UI Signals
    connect(fActions[kFileExit], SIGNAL(triggered()), this, SLOT(close()));
    connect(fActions[kFileOpenVault], SIGNAL(triggered()), this, SLOT(openGame()));
    connect(fActions[kFileSaveVault], SIGNAL(triggered()), this, SLOT(performSave()));
    connect(fActions[kVaultOpenNode], SIGNAL(triggered()), this, SLOT(openNode()));
    connect(fActions[kNodeUnLink], SIGNAL(triggered()), this, SLOT(unlinkNode()));
    connect(fActions[kNodeLink], SIGNAL(triggered()), this, SLOT(linkNode()));
    connect(fActions[kNodeCreate], SIGNAL(triggered()), this, SLOT(createNode()));
    connect(fActions[kNodeUnsubscribe], SIGNAL(triggered()), this, SLOT(closeNode()));
    //connect(fActions[kNodeRenameVault], SIGNAL(triggered()), this, SLOT(renameVault()));

    connect(fVaultTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
            this, SLOT(treeItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
    connect(fVaultTree, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(treeContextMenu(const QPoint&)));
    connect(fNodeTab, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
    connect(fGenericEditor, SIGNAL(typeModified()), this, SLOT(typeModified()));
    connect(this, SIGNAL(nodeChanged(unsigned int)), this, SLOT(refreshNode(unsigned int)));

    // Load UI Settings
    QSettings settings("PlasmaShop", "VaultShop");
    resize(settings.value("WinSize", QSize(480, 600)).toSize());
    if (settings.contains("WinPos"))
        move(settings.value("WinPos").toPoint());
    if (settings.value("WinMaximized", false).toBool())
        showMaximized();

    if (settings.contains("WinState"))
        restoreState(settings.value("WinState").toByteArray());

    fLastDir = settings.value("LastDir").toString();
    if (!fLastDir.isEmpty())
        loadGame(fLastDir);
}
コード例 #8
0
ファイル: AIManager.cpp プロジェクト: mattrudder/AckZombies
/**
* CAIManager::update
* @date Modified April 26, 2006
*/
void CAIManager::update(void)
{
	// go to the object manager and get the players and update the nodes corresponding to them
	CObjectManager* poObjectManager = CObjectManager::getInstancePtr();
	CObjectManager::ObjectList loPlayers;
	poObjectManager->getObjects(OBJ_PLAYER, &loPlayers);
	CObjectManager::ObjectList::iterator oPlayerIter = loPlayers.begin();

	// now that we have the players, check to see it there are any cluckin bombs to add as goals
	CObjectManager::ObjectList loBombs;
	poObjectManager->getObjects(OBJ_WEAPON_BIGCLUCKINGBOMB, &loBombs);
	CObjectManager::ObjectList::iterator oBombIter = loBombs.begin();
	while (oBombIter != loBombs.end())
	{
		loPlayers.push_back((*oBombIter));
		oBombIter++;
	}

	std::list<CAINode*>::iterator oNodeIter = m_loGoals.begin();

	bool bUpdateGoalLinks = false;
	if (m_bUpdateGoalLinks)
	{
		bUpdateGoalLinks = true;
		m_bUpdateGoalLinks = false;
	}

	while (oNodeIter != m_loGoals.end() && oPlayerIter != loPlayers.end())
	{
		// to cover the case of a big cluckin bomb, keep the goal node off the ground
		(*oNodeIter)->setPosition(D3DXVECTOR3(ACTOR_PTR(oPlayerIter)->getBV().centerPt.x, ((CPlayer*)loPlayers.front())->getBV().centerPt.y, ACTOR_PTR(oPlayerIter)->getBV().centerPt.z));

		if (bUpdateGoalLinks)
		{
			unlinkNode(*oNodeIter);
			linkNode(*oNodeIter);
		}			

		oNodeIter++;
		oPlayerIter++;
	}

	// cases where a player quits
	if (oNodeIter != m_loGoals.end())
	{
		while (oNodeIter != m_loGoals.end())
		{
			unlinkNode(*oNodeIter);
			delete *oNodeIter;
			oNodeIter = m_loGoals.erase(oNodeIter);
		}
	}
	
	// case where a player joins
	if (oPlayerIter != loPlayers.end())
	{
		while (oPlayerIter != loPlayers.end())
		{
			CAINode* newNode = new CAINode;
			// to cover the case of a big cluckin bomb, keep the goal node off the ground
			newNode->setPosition(D3DXVECTOR3(ACTOR_PTR(oPlayerIter)->getBV().centerPt.x, ((CPlayer*)loPlayers.front())->getBV().centerPt.y, ACTOR_PTR(oPlayerIter)->getBV().centerPt.z));
			newNode->setRadius(1.0f);
			m_loGoals.push_back(newNode);
			linkNode(newNode);
			oPlayerIter++;
		}
	}

	updateGroupLeaders();
	updateSpawnTriggers();
	updateCurrentObjective();

	// make sure this gets reset every time or the objectives will skip to gameover
	m_bSkipCurrentObjective = false;
}