package de.ivu.elect.presentation.menu;

import de.ivu.elect.jee.presentation.menu.AbstractMenuModelBuilder;
import de.ivu.elect.jee.presentation.menu.MenuEntry;

public abstract class AbstractSchritteMenuModelBuilder extends AbstractMenuModelBuilder {
  private static final long serialVersionUID = 1L;

  public Integer getSchrittIndex() {
    int result = 0;

    for (MenuEntry menuItem : getMenuEntriesSorted()) {
      if (menuItem.isRendered()) {
        if (menuItem.isTopicActive()) {
          return result;
        }

        result++;
      }
    }

    return 0;
  }
}
