/usr/include/osl/game_playing/csaTime.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 | #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
{
MilliSeconds start, opmove, mymove;
long mytimeleft, optimeleft;
public:
explicit CsaTime(long timeleft)
: mytimeleft(timeleft), optimeleft(timeleft)
{
mymove = opmove = start = MilliSeconds::now();
}
CsaTime(long myTimeLeft, long opTimeLeft)
: mytimeleft(myTimeLeft), optimeleft(opTimeLeft)
{
mymove = opmove = start = MilliSeconds::now();
}
long makeOpMove() {
opmove = MilliSeconds::now();
long ret = (long)floor((opmove - mymove).toSeconds());
if (ret == 0) { ret = 1; }
optimeleft -= ret;
return ret;
}
long makeMyMove() {
mymove = MilliSeconds::now();
long ret = (long)floor((mymove - opmove).toSeconds());
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:
|