Skip to content

Commit 213514d

Browse files
LysounCLOVIS-AI
authored andcommitted
tp3 step 4 solution
1 parent 1c4f6ff commit 213514d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

tp3/src/main/kotlin/fmt/kotlin/fundamentals/Main.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package fmt.kotlin.fundamentals
22

3+
import fmt.kotlin.fundamentals.cellar.Cellar
4+
import fmt.kotlin.fundamentals.cellar.WineBarrel
5+
36
fun main() {
47
val tooBigBarrel = WineBarrel(600)
58

tp3/src/main/kotlin/fmt/kotlin/fundamentals/Cellar.kt renamed to tp3/src/main/kotlin/fmt/kotlin/fundamentals/cellar/Cellar.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fmt.kotlin.fundamentals
1+
package fmt.kotlin.fundamentals.cellar
22

33
class Cellar private constructor(
44
ownerName: String,
@@ -41,7 +41,7 @@ class Cellar private constructor(
4141
4242
""".trimIndent()
4343

44-
for(wineBarrel in wineBarrels) {
44+
for (wineBarrel in wineBarrels) {
4545
description += wineBarrel.description() + "\n"
4646
}
4747

tp3/src/main/kotlin/fmt/kotlin/fundamentals/WineBarrel.kt renamed to tp3/src/main/kotlin/fmt/kotlin/fundamentals/cellar/WineBarrel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package fmt.kotlin.fundamentals
1+
package fmt.kotlin.fundamentals.cellar
22

33
class WineBarrel private constructor(
44
val capacityInLiters: Int = 225,
55
private var wineAgeInMonths: Int
66
) {
7-
fun age(monthsNumber: Int) {
7+
private fun age(monthsNumber: Int) {
88
wineAgeInMonths += monthsNumber
99
}
1010

@@ -21,7 +21,7 @@ class WineBarrel private constructor(
2121
}
2222
}
2323

24-
fun description(): String {
24+
internal fun description(): String {
2525
return """
2626
Capacité en litres: $capacityInLiters
2727
Âge du vin : $wineAgeInMonths

0 commit comments

Comments
 (0)