/usr/include/osl/rating/ratedMove.h is in libosl-dev 0.6.0-3.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | /* ratedMove.h
*/
#ifndef OSL_RATEDMOVE_H
#define OSL_RATEDMOVE_H
#include "osl/move.h"
#include <iosfwd>
namespace osl
{
namespace rating
{
class RatedMove
{
Move my_move;
signed short all_rating, optimistic_rating;
public:
RatedMove(Move move, int rating, int optimistic) : my_move(move), all_rating(rating), optimistic_rating(optimistic)
{
}
RatedMove(Move move, int rating) : my_move(move), all_rating(rating), optimistic_rating(rating)
{
}
RatedMove() : all_rating(0), optimistic_rating(0) {}
void setRating(int rating) { all_rating = rating; }
void setOptimisticRating(int rating) { optimistic_rating = rating; }
const Move move() const { return my_move; }
int rating() const { return all_rating; }
int optimisticRating() const { return optimistic_rating; }
};
std::ostream& operator<<(std::ostream& os, RatedMove const& moveLogProb);
inline bool operator==(RatedMove const& lhs, RatedMove const& rhs)
{
return lhs.move()==rhs.move() && lhs.rating()==rhs.rating();
}
inline bool operator<(RatedMove const& lhs, RatedMove const& rhs)
{
if (lhs.rating() != rhs.rating())
return lhs.rating() < rhs.rating();
if (lhs.optimisticRating() != rhs.optimisticRating())
return lhs.optimisticRating() < rhs.optimisticRating();
return lhs.move() < rhs.move();
}
inline bool operator>(RatedMove const& lhs, RatedMove const& rhs)
{
if (lhs.rating() != rhs.rating())
return lhs.rating() > rhs.rating();
if (lhs.optimisticRating() != rhs.optimisticRating())
return lhs.optimisticRating() > rhs.optimisticRating();
return lhs.move() < rhs.move();
}
}
using rating::RatedMove;
} // namespace osl
#endif /* OSl_RATEDMOVE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|