MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / addCmd_removeNode

Method addCmd_removeNode

Engine/source/ts/tsShapeConstruct.cpp:2568–2606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2566}
2567
2568bool TSShapeConstructor::ChangeSet::addCmd_removeNode(const TSShapeConstructor::ChangeSet::Command& newCmd)
2569{
2570 // No dependencies. Remove any previous command that references the node
2571
2572 String nodeName(newCmd.argv[0]);
2573 for (S32 index = mCommands.size() - 1; index >= 0; index--)
2574 {
2575 Command& cmd = mCommands[index];
2576 switch (cmd.type)
2577 {
2578 case CmdAddNode:
2579 if (namesEqual(cmd.argv[0], nodeName))
2580 {
2581 mCommands.erase(index); // Remove the added node
2582 return false;
2583 }
2584 break;
2585
2586 case CmdSetNodeTransform:
2587 case CmdSetNodeParent:
2588 if (namesEqual(cmd.argv[0], nodeName))
2589 mCommands.erase(index); // Remove any commands that reference the removed node
2590 break;
2591
2592 case CmdRenameNode:
2593 if (namesEqual(cmd.argv[1], nodeName))
2594 {
2595 nodeName = cmd.argv[0]; // Node is renamed
2596 mCommands.erase(index);
2597 }
2598 break;
2599
2600 default:
2601 break;
2602 }
2603 }
2604
2605 return true;
2606}
2607
2608//-----------------------------------------------------------------------------
2609// SEQUENCE COMMANDS

Callers

nothing calls this directly

Calls 3

namesEqualFunction · 0.85
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected