示例#1
0
sv::Obstacle* sv::ObstacleManager::CreateObstacle(uchar category, uchar lane)
{
	Obstacle* obstacle = Get();
	uchar pos = GetGrid()->GetInnerPos(lane);
	obstacle->Init(m_IdCount, GetGrid(), category);
	obstacle->Start(pos);

	LOG2(DEBUG_OBSTACLES, "Obstacle created: id: %i, pos: %i", m_IdCount, pos);
	
	if(m_IdCount == 255)
		m_IdCount = 1;
	else
		m_IdCount++;

	return obstacle;
}