title: Calcuation order value by considering dish and customer types
body: <p>I am trying to calculate the price of an order determined by the value of the dishes, type of dishes and the type of guest.</p>
  <p>Dish Class:</p>
  <pre><code>public class DishImplementation implements Dish {
  
      private String name;
      private double basePrice;
      private DishType type;
  
      public DishImplementation(String name, double basePrice, DishType type) {
          this.name = name;
          this.basePrice = basePrice;
          this.type = type;
          }
  
      @Override
      public String getName() {
          return name;
      }
  
      @Override
      public double getBasePrice() {
          return basePrice;
      }
  
      @Override
      public DishType getDishType() {
          return type;
      }
  </code></pre>
  <p>Guest class:</p>
  <pre><code>public class GuestImplementation implements Guest {
  
      private String name;
      private GuestType type;
  
      public GuestImplementation (String name, GuestType type) {
          this.type = type;
          this.name = name;
      }
  
      @Override
      public String getName() {
          return name;
      }
  
      @Override
      public GuestType getGuestType() {
          return type;
      }
  </code></pre>
  <p>And here is the class I am having problems with, the Order class:</p>
  <pre><code>public class OrderImplementation implements Order {
  
      private Guest guest;
      private List&lt;Dish&gt; dishes;
  
      public OrderImplementation(Guest guest, List&lt;Dish&gt; dishes) {
          this.guest = guest;
          this.dishes = dishes;
      }
  
      @Override
      public double calculatePrice() {
          double price = 0;
          int i = 0;
          double total = 0;
  
          if ((getDishes().equals(DishType.MAIN_DISH)) || (getDishes().contains(DishType.DESSERT)) || (getDishes().contains(DishType.STARTER))) {
              for (Dish a : dishes) {
                  Dish dish = dishes.get(i);
                  price = dish.getBasePrice();
                  total = total + price;
                  i++;
              }
              return total = (total * this.guest.getGuestType().getDiscountFactor()) * 0.8;
          }
              else {
                  for (Dish a : dishes) {
                      Dish dish = dishes.get(i);
                      price = dish.getBasePrice();
                      total = total + price;
                      i++;
                  }
                  return total = total * this.guest.getGuestType().getDiscountFactor();
              }
          }
  
      @Override
      public List&lt;Dish&gt; getDishes() {
          return dishes;
      }
  
      @Override
      public Guest getGuest() {
          return guest;
      }
  }
  </code></pre>
  <p>The different DishTypes:</p>
  <pre><code>public enum DishType {
      STARTER, MAIN_DISH, DESSERT, OTHER;
  }
  </code></pre>
  <p>My calculatePrice-method is working as intended (although I am sure it is overcomplicated, but that does not matter to me right now).</p>
  <p>Only thing that does not work is, that it needs to apply a 20% discound to an order if it consists of at least one dish with the type MAIN_DISH, DESSERT or STARTER.</p>
  <p>My approach is not working, since it always ignores my first if-condition.</p>
  <p>And I also wonder why I can't call</p>
  <pre><code>dishes.getDishType();
  </code></pre>
  <p>just like I did with the GuestTypes. I am sure that would solve my problem.</p>