Ejemplo n.º 1
0
 enum LocationType {
   // can only contain 4 types
   TARGET,
   ENEMY,
   MAP_LOW,
   MAP_HIGH,
   ;
   static final LocationType[] values = LocationType.values();
 }
 @Override
 public int hashCode() {
   int hashCode = 0;
   hashCode += type.hashCode();
   hashCode *= 29;
   if (id != 0) {
     hashCode += id;
   } else if (lat != 0 || lon != 0) {
     hashCode += lat;
     hashCode *= 29;
     hashCode += lon;
   }
   return hashCode;
 }
 public static LocationType getType(Cursor cursor) {
   return LocationType.values()[cursor.getInt(cursor.getColumnIndexOrThrow(C_TYPE))];
 }
Ejemplo n.º 4
0
 @Override
 public String toString() {
   return type.toString() + " " + x + " " + y;
 }