<commit_before>package pl.shockah.godwit.tree

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.GL20
import com.badlogic.gdx.utils.viewport.ScreenViewport
import com.badlogic.gdx.utils.viewport.Viewport
import pl.shockah.godwit.GodwitApplicationAdapter
import kotlin.math.min

open class TreeNodeGame(
		private val initialStageFactory: () -> Stage
) : GodwitApplicationAdapter() {
	companion object {
		operator fun invoke(stageLayerFactory: () -> StageLayer): TreeNodeGame {
			return TreeNodeGame { Stage(stageLayerFactory()) }
		}
	}

	private lateinit var backingStage: Stage

	var maximumDeltaTime: Float? = 1f / 15f

	var stage: Stage
		get() = backingStage
		set(new) {
			backingStage = new
			Gdx.input.inputProcessor = new
		}

	constructor(viewport: Viewport = ScreenViewport()) : this({ Stage(StageLayer(viewport)) })

	override fun create() {
		stage = initialStageFactory()
	}

	override fun resize(width: Int, height: Int) {
		stage.resize(width, height)
	}

	override fun render() {
		val gdxDelta = Gdx.graphics.deltaTime
		val delta = maximumDeltaTime?.let { min(gdxDelta, it) } ?: gdxDelta

		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
		stage.update(delta)
		stage.draw()
	}
}<commit_msg>Simplified TreeNodeGame.stage<commit_after>package pl.shockah.godwit.tree

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.GL20
import com.badlogic.gdx.utils.viewport.ScreenViewport
import com.badlogic.gdx.utils.viewport.Viewport
import pl.shockah.godwit.GodwitApplicationAdapter
import pl.shockah.godwit.LateInitAwaitable
import kotlin.math.min

open class TreeNodeGame(
		private val initialStageFactory: () -> Stage
) : GodwitApplicationAdapter() {
	companion object {
		operator fun invoke(stageLayerFactory: () -> StageLayer): TreeNodeGame {
			return TreeNodeGame { Stage(stageLayerFactory()) }
		}
	}

	var stage: Stage by LateInitAwaitable { _, _, new ->
		Gdx.input.inputProcessor = new
	}

	var maximumDeltaTime: Float? = 1f / 15f

	constructor(viewport: Viewport = ScreenViewport()) : this({ Stage(StageLayer(viewport)) })

	override fun create() {
		stage = initialStageFactory()
	}

	override fun resize(width: Int, height: Int) {
		stage.resize(width, height)
	}

	override fun render() {
		val gdxDelta = Gdx.graphics.deltaTime
		val delta = maximumDeltaTime?.let { min(gdxDelta, it) } ?: gdxDelta

		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
		stage.update(delta)
		stage.draw()
	}
}
{'fraction_non_alphanumeric': 0.11234567901234568, 'fraction_numerical': 0.005761316872427984, 'mean_word_length': 4.7334905660377355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '126636', 'n_tokens_mistral': 887, 'n_tokens_neox': 810, 'n_words': 166}