/usr/include/osl/game_playing/csaTime.h is in libosl-dev 0.8.0-1.4.
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 | #ifndef OSL_CSA_TIME_H
#define OSL_CSA_TIME_H
#include "osl/misc/milliSeconds.h"
#include <string>
#include <cmath>
namespace osl
{
namespace game_playing
{
class CsaTime
{
time_point start, opmove, mymove;
long mytimeleft, optimeleft;
public:
explicit CsaTime(long timeleft)
: mytimeleft(timeleft), optimeleft(timeleft)
{
mymove = opmove = start = clock::now();
}
CsaTime(long myTimeLeft, long opTimeLeft)
: mytimeleft(myTimeLeft), optimeleft(opTimeLeft)
{
mymove = opmove = start = clock::now();
}
long makeOpMove() {
opmove = clock::now();
long ret = (long)floor(toSeconds(opmove - mymove));
if (ret == 0) { ret = 1; }
optimeleft -= ret;
return ret;
}
long makeMyMove() {
mymove = clock::now();
long ret = (long)floor(toSeconds(mymove - opmove));
if(ret == 0) { ret = 1; }
mytimeleft -= ret;
return ret;
}
long getMyLeft() const { return mytimeleft; }
long getOpLeft() const { return optimeleft; }
const std::string getStart() const;
static const std::string curruntTime();
};
} // namespace game_playing
} // namespace osl
#endif // OSL_CSA_TIME
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|