diff options
Diffstat (limited to 'main/src/cgeo/geocaching/enumerations')
5 files changed, 60 insertions, 74 deletions
diff --git a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java index 530869f..243f63d 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java +++ b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java @@ -12,8 +12,8 @@ import java.util.HashMap; import java.util.Map; public enum CacheAttribute { - // THIS LIST IS GENERATED: don't change anything here but in - // project/attributes/makeEnum.sh + // THIS LIST IS GENERATED: don't change anything here but read + // project/attributes/readme.txt DOGS(1, -1, "dogs", R.drawable.attribute_dogs, R.string.attribute_dogs_yes, R.string.attribute_dogs_no), BICYCLES(32, -1, "bicycles", R.drawable.attribute_bicycles, R.string.attribute_bicycles_yes, R.string.attribute_bicycles_no), MOTORCYCLES(33, -1, "motorcycles", R.drawable.attribute_motorcycles, R.string.attribute_motorcycles_yes, R.string.attribute_motorcycles_no), @@ -27,7 +27,7 @@ public enum CacheAttribute { ONEHOUR(7, -1, "onehour", R.drawable.attribute_onehour, R.string.attribute_onehour_yes, R.string.attribute_onehour_no), SCENIC(8, -1, "scenic", R.drawable.attribute_scenic, R.string.attribute_scenic_yes, R.string.attribute_scenic_no), HIKING(9, 25, "hiking", R.drawable.attribute_hiking, R.string.attribute_hiking_yes, R.string.attribute_hiking_no), - CLIMBING(10, 28, "climbing", R.drawable.attribute_climbing, R.string.attribute_climbing_yes, R.string.attribute_climbing_no), + CLIMBING(10, -1, "climbing", R.drawable.attribute_climbing, R.string.attribute_climbing_yes, R.string.attribute_climbing_no), WADING(11, -1, "wading", R.drawable.attribute_wading, R.string.attribute_wading_yes, R.string.attribute_wading_no), SWIMMING(12, 29, "swimming", R.drawable.attribute_swimming, R.string.attribute_swimming_yes, R.string.attribute_swimming_no), AVAILABLE(13, 38, "available", R.drawable.attribute_available, R.string.attribute_available_yes, R.string.attribute_available_no), @@ -86,6 +86,7 @@ public enum CacheAttribute { SYRINGE(-1, 23, "syringe", R.drawable.attribute_syringe, R.string.attribute_syringe_yes, R.string.attribute_syringe_no), SWAMP(-1, 26, "swamp", R.drawable.attribute_swamp, R.string.attribute_swamp_yes, R.string.attribute_swamp_no), HILLS(-1, 27, "hills", R.drawable.attribute_hills, R.string.attribute_hills_yes, R.string.attribute_hills_no), + EASY_CLIMBING(-1, 28, "easy_climbing", R.drawable.attribute_easy_climbing, R.string.attribute_easy_climbing_yes, R.string.attribute_easy_climbing_no), POI(-1, 30, "poi", R.drawable.attribute_poi, R.string.attribute_poi_yes, R.string.attribute_poi_no), MOVING_TARGET(-1, 31, "moving_target", R.drawable.attribute_moving_target, R.string.attribute_moving_target_yes, R.string.attribute_moving_target_no), WEBCAM(-1, 32, "webcam", R.drawable.attribute_webcam, R.string.attribute_webcam_yes, R.string.attribute_webcam_no), @@ -107,9 +108,10 @@ public enum CacheAttribute { ARITHMETIC(-1, 56, "arithmetic", R.drawable.attribute_arithmetic, R.string.attribute_arithmetic_yes, R.string.attribute_arithmetic_no), OTHER_CACHE(-1, 57, "other_cache", R.drawable.attribute_other_cache, R.string.attribute_other_cache_yes, R.string.attribute_other_cache_no), ASK_OWNER(-1, 58, "ask_owner", R.drawable.attribute_ask_owner, R.string.attribute_ask_owner_yes, R.string.attribute_ask_owner_no), - UNKNOWN(-1, -1, "unknown", R.drawable.attribute_unknown, R.string.attribute_unknown_yes, R.string.attribute_unknown_no); - // THIS LIST IS GENERATED: don't change anything here but in - // project/attributes/makeEnum.sh + UNKNOWN(-1, -1, "unknown", R.drawable.attribute_unknown, R.string.attribute_unknown_yes, R.string.attribute_unknown_no), + GEOTOUR(67, -1, "geotour", R.drawable.attribute_geotour, R.string.attribute_geotour_yes, R.string.attribute_geotour_no); + // THIS LIST IS GENERATED: don't change anything here but read + // project/attributes/readme.txt private static final String INTERNAL_YES = "_yes"; private static final String INTERNAL_NO = "_no"; @@ -146,30 +148,20 @@ public enum CacheAttribute { } private final static Map<String, CacheAttribute> FIND_BY_GCRAWNAME; + private final static SparseArray<CacheAttribute> FIND_BY_GCID = new SparseArray<CacheAttribute>(); + private final static SparseArray<CacheAttribute> FIND_BY_OCID = new SparseArray<CacheAttribute>(); static { final HashMap<String, CacheAttribute> mapGcRawNames = new HashMap<String, CacheAttribute>(); for (CacheAttribute attr : values()) { mapGcRawNames.put(attr.rawName, attr); - } - FIND_BY_GCRAWNAME = Collections.unmodifiableMap(mapGcRawNames); - } - - private final static SparseArray<CacheAttribute> FIND_BY_GCID = new SparseArray<CacheAttribute>(); - static { - for (CacheAttribute attr : values()) { if (attr.gcid != NO_ID) { FIND_BY_GCID.put(attr.gcid, attr); } - } - } - - private final static SparseArray<CacheAttribute> FIND_BY_OCID = new SparseArray<CacheAttribute>(); - static { - for (CacheAttribute attr : values()) { if (attr.ocid != NO_ID) { FIND_BY_OCID.put(attr.ocid, attr); } } + FIND_BY_GCRAWNAME = Collections.unmodifiableMap(mapGcRawNames); } public static CacheAttribute getByRawName(final String rawName) { diff --git a/main/src/cgeo/geocaching/enumerations/CacheRealm.java b/main/src/cgeo/geocaching/enumerations/CacheRealm.java deleted file mode 100644 index 5a203ab..0000000 --- a/main/src/cgeo/geocaching/enumerations/CacheRealm.java +++ /dev/null @@ -1,22 +0,0 @@ -package cgeo.geocaching.enumerations; - -import cgeo.geocaching.R; - -public enum CacheRealm { - - GC("gc", "geocaching.com", R.drawable.marker, R.drawable.marker_disabled), - OC("oc", "OpenCaching Network", R.drawable.marker_oc, R.drawable.marker_disabled_oc), - OTHER("other", "Other", R.drawable.marker_other, R.drawable.marker_disabled_other); - - public final String id; - public final String name; - public final int markerId; - public final int markerDisabledId; - - CacheRealm(String id, String name, int markerId, int markerDisabledId) { - this.id = id; - this.name = name; - this.markerId = markerId; - this.markerDisabledId = markerDisabledId; - } -} diff --git a/main/src/cgeo/geocaching/enumerations/CacheType.java b/main/src/cgeo/geocaching/enumerations/CacheType.java index 528d3fa..6c63cac 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheType.java +++ b/main/src/cgeo/geocaching/enumerations/CacheType.java @@ -28,7 +28,8 @@ public enum CacheType { LOSTANDFOUND("lostfound", "Lost & Found", "3ea6533d-bb52-42fe-b2d2-79a3424d4728", R.string.lostfound, R.drawable.type_event), // icon missing PROJECT_APE("ape", "Project Ape Cache", "2555690d-b2bc-4b55-b5ac-0cb704c0b768", R.string.ape, R.drawable.type_ape), GCHQ("gchq", "Groundspeak HQ", "416f2494-dc17-4b6a-9bab-1a29dd292d8c", R.string.gchq, R.drawable.type_hq), - GPS_EXHIBIT("gps", "GPS Cache Exhibit", "72e69af2-7986-4990-afd9-bc16cbbb4ce3", R.string.gps, R.drawable.type_traditional), // icon missing + GPS_EXHIBIT("gps", "GPS Adventures Exhibit", "72e69af2-7986-4990-afd9-bc16cbbb4ce3", R.string.gps, R.drawable.type_event), // icon missing + BLOCK_PARTY("block", "Groundspeak Block Party", "bc2f3df2-1aab-4601-b2ff-b5091f6c02e3", R.string.block, R.drawable.type_event), // icon missing UNKNOWN("unknown", "unknown", "", R.string.unknown, R.drawable.type_unknown), /** No real cache type -> filter */ ALL("all", "display all caches", "9a79e6ce-3344-409c-bbe9-496530baf758", R.string.all_types, R.drawable.type_unknown); @@ -88,7 +89,8 @@ public enum CacheType { } public boolean isEvent() { - return CacheType.EVENT == this || CacheType.MEGA_EVENT == this || CacheType.CITO == this || CacheType.LOSTANDFOUND == this; + return CacheType.EVENT == this || CacheType.MEGA_EVENT == this || CacheType.CITO == this || + CacheType.LOSTANDFOUND == this || CacheType.BLOCK_PARTY == this; } @Override @@ -98,7 +100,7 @@ public enum CacheType { /** * Whether this type contains the given cache. - * + * * @param cache * @return true if this is the ALL type or if this type equals the type of the cache. */ @@ -111,4 +113,12 @@ public enum CacheType { } return cache.getType() == this; } + + public boolean applyDistanceRule() { + return !isVirtual() && !isEvent(); + } + + public boolean isVirtual() { + return VIRTUAL == this || WEBCAM == this || EARTH == this; + } } diff --git a/main/src/cgeo/geocaching/enumerations/LogType.java b/main/src/cgeo/geocaching/enumerations/LogType.java index 71a5146..9902d3f 100644 --- a/main/src/cgeo/geocaching/enumerations/LogType.java +++ b/main/src/cgeo/geocaching/enumerations/LogType.java @@ -15,50 +15,52 @@ import java.util.Map; */ public enum LogType { - FOUND_IT(2, "2", "found it", R.string.log_found, R.drawable.mark_green), - DIDNT_FIND_IT(3, "3", "didn't find it", R.string.log_dnf, R.drawable.mark_red), - NOTE(4, "4", "write note", R.string.log_note), - PUBLISH_LISTING(1003, "24", "publish listing", R.string.log_published, R.drawable.mark_green_more), - ENABLE_LISTING(23, "23", "enable listing", R.string.log_enabled, R.drawable.mark_green_more), - ARCHIVE(5, "5", "archive", R.string.log_archived, R.drawable.mark_red_more), - UNARCHIVE(12, "12", "unarchive", R.string.log_unarchived, R.drawable.mark_green_more), - TEMP_DISABLE_LISTING(22, "22", "temporarily disable listing", R.string.log_disabled, R.drawable.mark_red_more), - NEEDS_ARCHIVE(7, "7", "needs archived", R.string.log_needs_archived, R.drawable.mark_red), - WILL_ATTEND(9, "9", "will attend", R.string.log_attend), - ATTENDED(10, "10", "attended", R.string.log_attended, R.drawable.mark_green), - RETRIEVED_IT(13, "13", "retrieved it", R.string.log_retrieved, R.drawable.mark_green_more), - PLACED_IT(14, "14", "placed it", R.string.log_placed, R.drawable.mark_green_more), - GRABBED_IT(19, "19", "grabbed it", R.string.log_grabbed, R.drawable.mark_green_more), - NEEDS_MAINTENANCE(45, "45", "needs maintenance", R.string.log_maintenance_needed, R.drawable.mark_red), - OWNER_MAINTENANCE(46, "46", "owner maintenance", R.string.log_maintained, R.drawable.mark_green_more), - UPDATE_COORDINATES(47, "47", "update coordinates", R.string.log_update), - DISCOVERED_IT(48, "48", "discovered it", R.string.log_discovered, R.drawable.mark_green), - POST_REVIEWER_NOTE(18, "68", "post reviewer note", R.string.log_reviewer), - VISIT(1001, "75", "visit", R.string.log_tb_visit, R.drawable.mark_green), - WEBCAM_PHOTO_TAKEN(11, "11", "webcam photo taken", R.string.log_webcam, R.drawable.mark_green), - ANNOUNCEMENT(74, "74", "announcement", R.string.log_announcement), - MOVE_COLLECTION(69, "69", "unused_collection", R.string.log_movecollection), - MOVE_INVENTORY(70, "70", "unused_inventory", R.string.log_moveinventory), - RETRACT(25, "25", "retract listing", R.string.log_retractlisting), - MARKED_MISSING(16, "16", "marked missing", R.string.log_marked_missing, R.drawable.mark_red), - UNKNOWN(0, "unknown", "", R.string.err_unknown, R.drawable.mark_red); // LogType not init. yet + FOUND_IT(2, "2", "found it", "Found it", R.string.log_found, R.drawable.mark_green), + DIDNT_FIND_IT(3, "3", "didn't find it", "Didn't find it", R.string.log_dnf, R.drawable.mark_red), + NOTE(4, "4", "write note", "Comment", R.string.log_note), + PUBLISH_LISTING(1003, "24", "publish listing", "", R.string.log_published, R.drawable.mark_green_more), + ENABLE_LISTING(23, "23", "enable listing", "", R.string.log_enabled, R.drawable.mark_green_more), + ARCHIVE(5, "5", "archive", "", R.string.log_archived, R.drawable.mark_red_more), + UNARCHIVE(12, "12", "unarchive", "", R.string.log_unarchived, R.drawable.mark_green_more), + TEMP_DISABLE_LISTING(22, "22", "temporarily disable listing", "", R.string.log_disabled, R.drawable.mark_red_more), + NEEDS_ARCHIVE(7, "7", "needs archived", "", R.string.log_needs_archived, R.drawable.mark_red), + WILL_ATTEND(9, "9", "will attend", "Will attend", R.string.log_attend), + ATTENDED(10, "10", "attended", "Attended", R.string.log_attended, R.drawable.mark_green), + RETRIEVED_IT(13, "13", "retrieved it", "", R.string.log_retrieved, R.drawable.mark_green_more), + PLACED_IT(14, "14", "placed it", "", R.string.log_placed, R.drawable.mark_green_more), + GRABBED_IT(19, "19", "grabbed it", "", R.string.log_grabbed, R.drawable.mark_green_more), + NEEDS_MAINTENANCE(45, "45", "needs maintenance", "Comment", R.string.log_maintenance_needed, R.drawable.mark_red), + OWNER_MAINTENANCE(46, "46", "owner maintenance", "", R.string.log_maintained, R.drawable.mark_green_more), + UPDATE_COORDINATES(47, "47", "update coordinates", "", R.string.log_update), + DISCOVERED_IT(48, "48", "discovered it", "", R.string.log_discovered, R.drawable.mark_green), + POST_REVIEWER_NOTE(18, "68", "post reviewer note", "", R.string.log_reviewer), + VISIT(1001, "75", "visit", "", R.string.log_tb_visit, R.drawable.mark_green), + WEBCAM_PHOTO_TAKEN(11, "11", "webcam photo taken", "", R.string.log_webcam, R.drawable.mark_green), + ANNOUNCEMENT(74, "74", "announcement", "", R.string.log_announcement), + MOVE_COLLECTION(69, "69", "unused_collection", "", R.string.log_movecollection), + MOVE_INVENTORY(70, "70", "unused_inventory", "", R.string.log_moveinventory), + RETRACT(25, "25", "retract listing", "", R.string.log_retractlisting), + MARKED_MISSING(16, "16", "marked missing", "", R.string.log_marked_missing, R.drawable.mark_red), + UNKNOWN(0, "unknown", "", "", R.string.err_unknown, R.drawable.mark_red); // LogType not init. yet public final int id; public final String iconName; public final String type; + public final String oc_type; private final int stringId; public final int markerId; - LogType(int id, String iconName, String type, int stringId, int markerId) { + LogType(int id, String iconName, String type, String oc_type, int stringId, int markerId) { this.id = id; this.iconName = iconName; this.type = type; + this.oc_type = oc_type; this.stringId = stringId; this.markerId = markerId; } - LogType(int id, String iconName, String type, int stringId) { - this(id, iconName, type, stringId, R.drawable.mark_gray); + LogType(int id, String iconName, String type, String oc_type, int stringId) { + this(id, iconName, type, oc_type, stringId, R.drawable.mark_gray); } private final static Map<String, LogType> FIND_BY_ICONNAME; diff --git a/main/src/cgeo/geocaching/enumerations/WaypointType.java b/main/src/cgeo/geocaching/enumerations/WaypointType.java index 748c432..79c8106 100644 --- a/main/src/cgeo/geocaching/enumerations/WaypointType.java +++ b/main/src/cgeo/geocaching/enumerations/WaypointType.java @@ -72,4 +72,8 @@ public enum WaypointType { public final String toString() { return getL10n(); } + + public boolean applyDistanceRule() { + return (this == FINAL || this == STAGE); + } } |
