| 2845 | } |
| 2846 | |
| 2847 | bool TSShapeConstructor::ChangeSet::addCmd_removeSequence(const TSShapeConstructor::ChangeSet::Command& newCmd) |
| 2848 | { |
| 2849 | // Remove any previous command that references the sequence, but stop if the |
| 2850 | // sequence is used as a source for addSequence |
| 2851 | |
| 2852 | String seqName(newCmd.argv[0]); |
| 2853 | for (S32 index = mCommands.size() - 1; index >= 0; index--) |
| 2854 | { |
| 2855 | Command& cmd = mCommands[index]; |
| 2856 | switch (cmd.type) |
| 2857 | { |
| 2858 | case CmdAddSequence: |
| 2859 | if (namesEqual(cmd.argv[1], seqName)) |
| 2860 | { |
| 2861 | mCommands.erase(index); // Remove the added sequence |
| 2862 | return false; |
| 2863 | } |
| 2864 | else if (namesEqual(cmd.argv[0], seqName)) |
| 2865 | { |
| 2866 | // Removed sequence is used as source for another sequence => can't |
| 2867 | // go back any further |
| 2868 | return true; |
| 2869 | } |
| 2870 | break; |
| 2871 | |
| 2872 | case CmdRenameSequence: |
| 2873 | if (namesEqual(cmd.argv[1], seqName)) |
| 2874 | { |
| 2875 | seqName = cmd.argv[0]; // Sequence is renamed |
| 2876 | mCommands.erase(index); |
| 2877 | } |
| 2878 | break; |
| 2879 | |
| 2880 | case CmdSetSequencePriority: |
| 2881 | case CmdSetSequenceGroundSpeed: |
| 2882 | case CmdSetSequenceCyclic: |
| 2883 | case CmdSetSequenceBlend: |
| 2884 | case CmdAddTrigger: |
| 2885 | case CmdRemoveTrigger: |
| 2886 | if (namesEqual(cmd.argv[0], seqName)) |
| 2887 | mCommands.erase(index); // Remove any commands that reference the removed sequence |
| 2888 | break; |
| 2889 | |
| 2890 | default: |
| 2891 | break; |
| 2892 | } |
| 2893 | } |
| 2894 | |
| 2895 | return true; |
| 2896 | } |
| 2897 | |
| 2898 | bool TSShapeConstructor::ChangeSet::addCmd_addTrigger(const TSShapeConstructor::ChangeSet::Command& newCmd) |
| 2899 | { |
nothing calls this directly
no test coverage detected