| 1043 | } |
| 1044 | |
| 1045 | static GameValue ListForEach(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 1046 | { |
| 1047 | GameVarSpace local(state->GetContext()); |
| 1048 | state->BeginContext(&local); |
| 1049 | RString expression = oper1; |
| 1050 | const GameArrayType& array = oper2; |
| 1051 | for (int i = 0; i < array.Size(); i++) |
| 1052 | { |
| 1053 | const GameValue& val = array[i]; |
| 1054 | // set local varible - will be deleted on EndContext |
| 1055 | state->VarSetLocal("_x", val, true); |
| 1056 | const_cast<GameState*>(state)->Execute(expression); |
| 1057 | if (state->GetLastError()) |
| 1058 | { |
| 1059 | state->EndContext(); |
| 1060 | return GameValue(); |
| 1061 | } |
| 1062 | } |
| 1063 | state->EndContext(); |
| 1064 | return NOTHING; |
| 1065 | } |
| 1066 | |
| 1067 | static GameValue ListIsIn(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 1068 | { |
nothing calls this directly
no test coverage detected