OpenGTA/math/weighted_set.h
Anonymous Maarten e20673c2cd 2007-04-16
2015-12-03 01:37:37 +01:00

21 lines
369 B
C++

#ifndef WEIGHTED_SET_H
#define WEIGHTED_SET_H
#include <vector>
#include "yasli/random.h"
namespace Math {
class WeightedSet {
public:
WeightedSet(unsigned int seed);
void add(unsigned int w, unsigned int e);
unsigned int getRandom();
private:
std::vector<unsigned int> elements;
Random rng;
};
}
#endif