36 lines
709 B
C++
36 lines
709 B
C++
#ifndef RACELISTGENERATOR_H
|
|
#define RACELISTGENERATOR_H
|
|
|
|
#include <algorithm> // shuffle list
|
|
#include <ctime>
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
using std::cout;
|
|
using std::endl;
|
|
using std::vector;
|
|
|
|
struct Combination {
|
|
int driver;
|
|
int car;
|
|
};
|
|
|
|
|
|
class RaceListGenerator
|
|
{
|
|
public:
|
|
RaceListGenerator(vector<int> driverIds, vector<int> carIds);
|
|
vector<vector<int>> getList() ;
|
|
|
|
private:
|
|
void print(vector<int> v);
|
|
static int myrandom(int i);
|
|
bool matchList(vector<struct Combination> x1, vector<struct Combination> x2);
|
|
bool matchCombination(struct Combination x1, struct Combination x2);
|
|
|
|
vector<int> driverIds;
|
|
vector<int> carIds;
|
|
};
|
|
|
|
#endif // RACELISTGENERATOR_H
|