package ru.dbotthepony.mc.otm.menu.widget

import kotlin.math.min

interface IProgressGaugeWidget {
	val isStuck: Boolean
	val progress: Float

	interface WithTicks : IProgressGaugeWidget {
		val workTicks: Int
		val totalTicks: Int

		override val progress: Float
			get() = if (totalTicks <= 0 || workTicks <= 0) 0f else min(1f, workTicks.toFloat() / totalTicks.toFloat())
	}
}
