package de.mrunde.bachelorthesis.basics;

import de.mrunde.bachelorthesis.R;

/**
 * Categories of landmarks (e.g. gas station, hospital, post office)
 * 
 * @author Marius Runde
 */
public abstract class LandmarkCategory {

	/**
	 * Church
	 */
	public final static String CHURCH = "church";

	/**
	 * Cinema
	 */
	public final static String CINEMA = "cinema";

	/**
	 * Harbour
	 */
	public final static String HARBOUR = "harbour";

	/**
	 * Lake or water body in general
	 */
	public final static String LAKE = "lake";

	/**
	 * Restaurant
	 */
	public final static String RESTAURANT = "restaurant";

	/**
	 * Check if a category is a valid landmark category
	 * 
	 * @param category
	 *            Category to be controlled
	 * @return TRUE: <code>category</code> is valid<br/>
	 *         FALSE: <code>category</code> is not valid
	 */
	public static boolean isCategory(String category) {
		if (category.equals(CHURCH))
			return true;
		if (category.equals(CINEMA))
			return true;
		if (category.equals(HARBOUR))
			return true;
		if (category.equals(LAKE))
			return true;
		if (category.equals(RESTAURANT))
			return true;
		return false;
	}

	/**
	 * Get all landmark categories
	 * 
	 * @return All categories
	 */
	public static String[] getCategories() {
		String[] categories = { CHURCH, CINEMA, HARBOUR, LAKE, RESTAURANT };
		return categories;
	}

	/**
	 * Get the id of the corresponding image file for this landmark category
	 * 
	 * @param category
	 *            The landmark category
	 * @return The id of the corresponding image file. -1 if
	 *         <code>category</category> is not a valid landmark category
	 */
	public static int getDrawableId(String category) {
		if (isCategory(category)) {
			if (category.equals(CHURCH))
				return R.drawable.landmark_church;
			if (category.equals(CINEMA))
				return -1; // TODO
			if (category.equals(HARBOUR))
				return -1; // TODO
			if (category.equals(LAKE))
				return -1; // TODO
			if (category.equals(RESTAURANT))
				return -1; // TODO
		}
		return -1;
	}
}

@@ -307,82 +307,8 @@
 %0D%0A%0D%0A
-%09/**%0D%0A%09 * Cinema%0D%0A%09 */%0D%0A%09public final static String CINEMA = %22cinema%22;%0D%0A%0D%0A
 %09/**
@@ -322,16 +322,16 @@
 arbour%0D%0A
+
 %09 */%0D%0A%09p
@@ -555,24 +555,92 @@
 aurant%22;%0D%0A%0D%0A
+%09/**%0D%0A%09 * Shop%0D%0A%09 */%0D%0A%09public final static String SHOP = %22shop%22;%0D%0A%0D%0A
 %09/**%0D%0A%09 * Ch
@@ -979,57 +979,8 @@
 e;%0D%0A
-%09%09if (category.equals(CINEMA))%0D%0A%09%09%09return true;%0D%0A
 %09%09if
@@ -1125,16 +1125,63 @@
  true;%0D%0A
+%09%09if (category.equals(SHOP))%0D%0A%09%09%09return true;%0D%0A
 %09%09return
@@ -1354,16 +1354,8 @@
 RCH,
- CINEMA,
  HAR
@@ -1376,16 +1376,22 @@
 STAURANT
+, SHOP
  %7D;%0D%0A%09%09r
@@ -1859,65 +1859,8 @@
 h;%0D%0A
-%09%09%09if (category.equals(CINEMA))%0D%0A%09%09%09%09return -1; // TODO%0D%0A
 %09%09%09i
@@ -1960,32 +1960,32 @@
 rn -1; // TODO%0D%0A
-
 %09%09%09if (category.
@@ -2029,16 +2029,71 @@
 / TODO%0D%0A
+%09%09%09if (category.equals(SHOP))%0D%0A%09%09%09%09return -1; // TODO%0D%0A
 %09%09%7D%0D%0A%09%09r

Update landmark categories