Descriptors are inequal if one has colorizations and the other doesn't.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1471 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2002-06-18 04:55:44 +00:00
parent abcc329e78
commit 1f32380f62
@@ -1,5 +1,5 @@
// //
// $Id: CharacterDescriptor.java,v 1.7 2002/05/06 18:08:31 mdb Exp $ // $Id: CharacterDescriptor.java,v 1.8 2002/06/18 04:55:44 shaper Exp $
package com.threerings.cast; package com.threerings.cast;
@@ -76,19 +76,24 @@ public class CharacterDescriptor
return false; return false;
} }
// if neither has colorizations, we're clear
Colorization[][] zations = odesc._zations; Colorization[][] zations = odesc._zations;
if (zations == null && _zations == null) { if (zations == null && _zations == null) {
// if neither has colorizations, we're clear
return true; return true;
} else if (zations == null || _zations == null) {
// if one has colorizations whilst the other doesn't, they
// can't be equal
return false;
} }
// otherwise, all of the colorizations must be equal as well // otherwise, all of the colorizations must be equal as well
int zlength = _zations.length; int zlength = zations.length;
if (zlength != zations.length) { if (zlength != _zations.length) {
return false; return false;
} }
for (int i = 0; i < zlength; i++) { for (int ii = 0; ii < zlength; ii++) {
if (!Arrays.equals(_zations[i], zations[i])) { if (!Arrays.equals(_zations[ii], zations[ii])) {
return false; return false;
} }
} }