diff options
Diffstat (limited to 'src/core/basetypes/MCArray.cpp')
-rw-r--r-- | src/core/basetypes/MCArray.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/basetypes/MCArray.cpp b/src/core/basetypes/MCArray.cpp index 787dd0ba..9fa69ccb 100644 --- a/src/core/basetypes/MCArray.cpp +++ b/src/core/basetypes/MCArray.cpp @@ -253,6 +253,24 @@ String * Array::componentsJoinedByString(String * delimiter) return result; } +bool Array::isEqual(Object * otherObject) +{ + Array * otherArray = (Array *) otherObject; + if (otherArray->count() != count()) { + return false; + } + bool result = true; + mc_foreacharrayIndex(i, Object, value, this) { + Object * otherValue = otherArray->objectAtIndex(i); + if (!value->isEqual(otherValue)) { + result = false; + break; + } + } + + return result; +} + HashMap * Array::serializable() { HashMap * result = Object::serializable(); |