| 2566 | } |
| 2567 | |
| 2568 | bool 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 |
nothing calls this directly
no test coverage detected