package net.shadowfacts.cacao.util.properties import kotlin.reflect.KProperty /** * @author shadowfacts */ class ResettableLazyProperty(val initializer: () -> Value) { var value: Value? = null operator fun getValue(thisRef: Any, property: KProperty<*>): Value { if (value == null) { value = initializer() } return value!! } fun reset() { value = null } }