예제 #1
0
void GameTime::addTicks(uint64_t ticks)
{
	this->ticks += ticks;
	this->datetime += ticksToPosix(ticks);
	uint64_t dayTicks = this->ticks % TICKS_PER_DAY;
	if (dayTicks < ticks)
	{
		uint64_t days = this->ticks / TICKS_PER_DAY;
		dayPassedFlag = true;
		if (days % 7 == 0)
		{
			weekPassedFlag = true;
		}
	}
}
예제 #2
0
static boost::posix_time::ptime getPtime(uint64_t ticks)
{
	return GAME_START + ticksToPosix(ticks);
}
예제 #3
0
boost::posix_time::ptime GameTime::getPtime() const { return GAME_START + ticksToPosix(ticks); }
예제 #4
0
GameTime::GameTime(uint64_t ticks) : ticks(ticks), dayPassedFlag(false), weekPassedFlag(false)
{
	datetime = GAME_START + ticksToPosix(ticks);
}