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

Method addCmd_addTrigger

Engine/source/ts/tsShapeConstruct.cpp:2898–2929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2896}
2897
2898bool TSShapeConstructor::ChangeSet::addCmd_addTrigger(const TSShapeConstructor::ChangeSet::Command& newCmd)
2899{
2900 // Remove a matching removeTrigger command, but stop if the sequence is used as
2901 // a source for addSequence (since triggers are copied).
2902
2903 for (S32 index = mCommands.size() - 1; index >= 0; index--)
2904 {
2905 Command& cmd = mCommands[index];
2906 switch (cmd.type)
2907 {
2908 case CmdRemoveTrigger:
2909 if (namesEqual(cmd.argv[0], newCmd.argv[0]) &&
2910 cmd.argv[1] == newCmd.argv[1] &&
2911 cmd.argv[2] == newCmd.argv[2])
2912 {
2913 mCommands.erase(index); // Remove previous removeTrigger command
2914 return false;
2915 }
2916 break;
2917
2918 case CmdAddSequence:
2919 if (namesEqual(cmd.argv[1], newCmd.argv[0]))
2920 return true; // Sequence is used as a source => cannot go back further
2921 break;
2922
2923 default:
2924 break;
2925 }
2926 }
2927
2928 return true;
2929}
2930
2931bool TSShapeConstructor::ChangeSet::addCmd_removeTrigger(const TSShapeConstructor::ChangeSet::Command& newCmd)
2932{

Callers

nothing calls this directly

Calls 3

namesEqualFunction · 0.85
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected