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

Method addCmd_removeSequence

Engine/source/ts/tsShapeConstruct.cpp:2847–2896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2845}
2846
2847bool 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
2898bool TSShapeConstructor::ChangeSet::addCmd_addTrigger(const TSShapeConstructor::ChangeSet::Command& newCmd)
2899{

Callers

nothing calls this directly

Calls 3

namesEqualFunction · 0.85
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected