| 2929 | } |
| 2930 | |
| 2931 | bool TSShapeConstructor::ChangeSet::addCmd_removeTrigger(const TSShapeConstructor::ChangeSet::Command& newCmd) |
| 2932 | { |
| 2933 | // Remove a matching addTrigger command, but stop if the sequence is used as |
| 2934 | // a source for addSequence (since triggers are copied). |
| 2935 | |
| 2936 | for (S32 index = mCommands.size() - 1; index >= 0; index--) |
| 2937 | { |
| 2938 | Command& cmd = mCommands[index]; |
| 2939 | switch (cmd.type) |
| 2940 | { |
| 2941 | case CmdAddTrigger: |
| 2942 | if (namesEqual(cmd.argv[0], newCmd.argv[0]) && |
| 2943 | cmd.argv[1] == newCmd.argv[1] && |
| 2944 | cmd.argv[2] == newCmd.argv[2]) |
| 2945 | { |
| 2946 | mCommands.erase(index); // Remove previous addTrigger command |
| 2947 | return false; |
| 2948 | } |
| 2949 | break; |
| 2950 | |
| 2951 | case CmdAddSequence: |
| 2952 | if (namesEqual(cmd.argv[1], newCmd.argv[0])) |
| 2953 | return true; // Sequence is used as a source => cannot go back further |
| 2954 | break; |
| 2955 | |
| 2956 | default: |
| 2957 | break; |
| 2958 | } |
| 2959 | } |
| 2960 | |
| 2961 | return true; |
| 2962 | } |
| 2963 | |
| 2964 | //----------------------------------------------------------------------------- |
| 2965 | // MESH COMMANDS |
nothing calls this directly
no test coverage detected