Revision e342c3f7
Added by Leszek Koltunski almost 2 years ago
src/main/java/org/distorted/objectlib/helpers/ObjectSignature.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
27 | 27 |
|
28 |
public class ObjectSignature |
|
28 |
public class ObjectSignature implements Comparable<ObjectSignature>
|
|
29 | 29 |
{ |
30 | 30 |
private long mSignature1, mSignature2, mSignature3; |
31 | 31 |
private int[] mLayer; |
... | ... | |
163 | 163 |
mSignature3 = sig; |
164 | 164 |
} |
165 | 165 |
|
166 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
167 |
|
|
168 |
public int compareTo(ObjectSignature sig) |
|
169 |
{ |
|
170 |
if( mSignature1>sig.mSignature1 ) return +1; |
|
171 |
else if( mSignature1<sig.mSignature1 ) return -1; |
|
172 |
else |
|
173 |
{ |
|
174 |
if( mSignature2>sig.mSignature2 ) return +1; |
|
175 |
else if( mSignature2<sig.mSignature2 ) return -1; |
|
176 |
else |
|
177 |
{ |
|
178 |
if( mSignature3>sig.mSignature3 ) return +1; |
|
179 |
else if( mSignature3<sig.mSignature3 ) return -1; |
|
180 |
else return 0; |
|
181 |
} |
|
182 |
} |
|
183 |
} |
|
184 |
|
|
166 | 185 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
167 | 186 |
|
168 | 187 |
public boolean isEqual(ObjectSignature sig) |
Also available in: Unified diff
Introduce BlacklistedSignatures singleton: during type2 scrambling (locally-produced bandaged cuboids) remember the signatures that we've previously proven to be leading to a dead-end.