| 469 | |
| 470 | |
| 471 | Dynamic Dynamic::operator+(const Dynamic &inRHS) const |
| 472 | { |
| 473 | int t1 = mPtr ? mPtr->__GetType() : vtNull; |
| 474 | int t2 = inRHS.mPtr ? inRHS.mPtr->__GetType() : vtNull; |
| 475 | |
| 476 | if ( (t1==vtInt || t1==vtFloat) && (t2==vtInt || t2==vtFloat) ) |
| 477 | { |
| 478 | return mPtr->__ToDouble() + inRHS.mPtr->__ToDouble(); |
| 479 | } |
| 480 | if (!mPtr) |
| 481 | return String() + inRHS; |
| 482 | if (!inRHS.mPtr) |
| 483 | return *this + String(); |
| 484 | |
| 485 | return const_cast<hx::Object*>(mPtr)->toString() + const_cast<Dynamic&>(inRHS)->toString(); |
| 486 | } |
| 487 | |
| 488 | #define DYN_OP_ADD(TYPE) \ |
| 489 | Dynamic Dynamic::operator+(const TYPE &i) const \ |