OOP_IO-2x_2023-mirror/Java/lab_6/Track.kt

15 lines
475 B
Kotlin
Raw Normal View History

2023-06-07 15:37:53 +03:00
package OOP.Java.lab_6
import kotlin.time.Duration
open class Track(val numberInAlbum: Int, val trackName: String, val feature: String?, val duration: Duration) {
open val style = ""
override fun toString(): String {
return if (this.feature == null) {
"#${this.numberInAlbum}: ${this.trackName} (${this.duration})"
} else {
"#${this.numberInAlbum}: ${this.trackName} ft. ${this.feature} (${this.duration})"
}
}
}