예제 #1
0
void TimerSystem::update(Register &reg, const double dt) {
	HandleManager* handleManager = reg.getHandleManager();
	GameObjectManager* gameObjectManager = reg.getGameObjectManager();

	GameObjectList gameObjectList = gameObjectManager->getGameObjectsWithComponents(componentList);
	GameObject* gameObject;
	TimerComponent* timerComponent;
	for (gameObject = gameObjectList.next(); gameObject; gameObject = gameObjectList.next()) {
		timerComponent = gameObject->getComponent<TimerComponent>(*handleManager, TIMER_COMPONENT);
		if (timerComponent) {
			timerComponent->tick(dt);
		}
	}
}