package ru.dbotthepony.kstarbound.util

class ManualLazy<T>(private val initializer: () -> T) : Lazy<T> {
	private var parent: Lazy<T> = lazy(initializer)

	override val value: T
		get() = parent.value

	override fun isInitialized(): Boolean {
		return parent.isInitialized()
	}

	fun invalidate() {
		parent = lazy(initializer)
	}
}
