microbit: added comparators to CompassSample

Added two new comparator operations equals and not equals to make the
task of comparing two CompassSamples Simpler.
This commit is contained in:
James Devine 2016-02-02 20:41:40 +00:00
parent 5e7334b0bf
commit 0412a5b322

View file

@ -97,6 +97,16 @@ struct CompassSample
this->y = y;
this->z = z;
}
bool operator==(const CompassSample& other) const
{
return x == other.x && y == other.y && z == other.z;
}
bool operator!=(const CompassSample& other) const
{
return !(x == other.x && y == other.y && z == other.z);
}
};
/**