new test cases

worked on all walkers
new helper methods
new distributions
some bugfixes
This commit is contained in:
2016-02-02 21:43:15 +01:00
parent ec86b07c43
commit 2e2c1a3004
18 changed files with 363 additions and 41 deletions

View File

@@ -46,6 +46,10 @@ public:
return (Heading(*this) += _rad);
}
/** compare two headings */
bool operator == (const Heading other) const {return rad == other.rad;}
bool operator != (const Heading other) const {return rad != other.rad;}
/** get an inverted version of this heading (upwards -> downwards, left -> right, ...) */
Heading getInverted() const {
Heading out(rad);
@@ -57,9 +61,10 @@ public:
/** get a random heading */
static Heading rnd() {
static std::minstd_rand gen; gen.seed(1234);
static std::minstd_rand gen(1234);
static std::uniform_real_distribution<float> dist(0, _2PI);
return Heading(dist(gen));
const float rnd = dist(gen);
return Heading(rnd);
}
#undef _2PI