| 474 | } |
| 475 | |
| 476 | static GameValue ListSub(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 477 | { |
| 478 | // make return object to avoid unneccessary copy |
| 479 | GameValue retValue(new GameDataArray); |
| 480 | GameArrayType& ret = retValue; |
| 481 | |
| 482 | const GameArrayType& op1 = oper1; |
| 483 | const GameArrayType& op2 = oper2; |
| 484 | ret.Realloc(op1.Size()); |
| 485 | |
| 486 | for (int i = 0; i < op1.Size(); i++) |
| 487 | { |
| 488 | // check if it is member of op2 |
| 489 | bool isInOp2 = false; |
| 490 | for (int j = 0; j < op2.Size(); j++) |
| 491 | { |
| 492 | if (op1[i].IsEqualTo(op2[j])) |
| 493 | { |
| 494 | isInOp2 = true; |
| 495 | break; |
| 496 | } |
| 497 | } |
| 498 | if (isInOp2) |
| 499 | { |
| 500 | continue; |
| 501 | } |
| 502 | // if not, add it to returned list |
| 503 | ret.Add(op1[i]); |
| 504 | } |
| 505 | return retValue; |
| 506 | } |
| 507 | |
| 508 | static GameValue BoolAnd(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 509 | { |