| 453 | } |
| 454 | |
| 455 | static GameValue ListAdd(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 456 | { |
| 457 | // make return object to avoid unneccessary copy |
| 458 | GameValue retValue(new GameDataArray); |
| 459 | GameArrayType& ret = retValue; |
| 460 | |
| 461 | const GameArrayType& add1 = oper1; |
| 462 | const GameArrayType& add2 = oper2; |
| 463 | ret.Realloc(add1.Size() + add2.Size()); |
| 464 | |
| 465 | for (int i = 0; i < add1.Size(); i++) |
| 466 | { |
| 467 | ret.Add(add1[i]); |
| 468 | } |
| 469 | for (int i = 0; i < add2.Size(); i++) |
| 470 | { |
| 471 | ret.Add(add2[i]); |
| 472 | } |
| 473 | return retValue; |
| 474 | } |
| 475 | |
| 476 | static GameValue ListSub(const GameState* state, GameValuePar oper1, GameValuePar oper2) |
| 477 | { |