#pragma once

/************************************************************************
    MeOS - Orienteering Software
    Copyright (C) 2009-2011 Melin Software HB
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Melin Software HB - software@melin.nu - www.melin.nu
    Stigbergsvägen 7, SE-75242 UPPSALA, Sweden
    
************************************************************************/

#include <vector>

class ClassConfigInfo {
public:
  vector <vector<int>> timeStart;
  vector<int> individual;
  vector<int> relay;
  vector<int> patrol;

  vector< vector<int> > legNStart;
  vector< vector<int> > raceNStart;

  vector< vector<int> > legNRes;
  vector< vector<int> > raceNRes;

  vector<int> rogainingClasses;

  // True if predefined forking
  bool hasMultiCourse;

  // True if there are rented cards
  bool hasRentedCard;

  vector<string> classWithoutCourse; 

  void clear();

  bool hasIndividual() const {return individual.size()>0;}
  bool hasRelay() const {return relay.size()>0;}
  bool hasPatrol() const {return patrol.size()>0;}
  bool hasRogaining() const {return rogainingClasses.size()>0;}
  bool empty() const;

  void getIndividual(set<int> &sel) const;
  void getRelay(set<int> &sel) const;
  void getPatrol(set<int> &sel) const;
  void getTeamClass(set<int> &sel) const;
  void getRogaining(set<int> &sel) const;

  bool hasTeamClass() const;

  void getRaceNStart(int race, set<int> &sel) const;
  void getLegNStart(int leg, set<int> &sel) const;

  void getRaceNRes(int race, set<int> &sel) const;
  void getLegNRes(int leg, set<int> &sel) const;

  void getTimeStart(int leg, set<int> &sel) const;

  int getNumLegsTotal() const {return max(legNRes.size(), raceNRes.size());}
};
