-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from jetbrains-academy/finalize-project
Finalize project
- Loading branch information
Showing
400 changed files
with
38,336 additions
and
21,357 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...yServerAddSpices/src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/GameService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.jetbrains.kotlin.course.culinary.game | ||
|
||
import org.jetbrains.kotlin.course.culinary.game.recipes.* | ||
import org.jetbrains.kotlin.course.culinary.models.food.CutVegetable | ||
import org.jetbrains.kotlin.course.culinary.models.food.Vegetable | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class CookingService { | ||
fun cookTomatoSoup() { | ||
val tomatoes = getTomatoesForSoup() | ||
prepareTomatoes(tomatoes) | ||
pot.simmer() | ||
} | ||
|
||
fun cookWithSpices() { | ||
val spices = generateSpices() | ||
addSpices(spices) | ||
pot.simmer() | ||
} | ||
|
||
fun cookSaladAsList() { | ||
mixVegetablesForSalad(getFreshVegetables().cut()) | ||
} | ||
|
||
fun cookSaladAsSequence() { | ||
mixVegetablesForSalad(getFreshVegetables().asSequence().cut()) | ||
} | ||
|
||
private fun Sequence<Vegetable>.cut(): List<CutVegetable> = map { kitchen.put(it) } | ||
.map { kitchen.cut(it) } | ||
.take(NUM_VEGETABLES_FOR_SALAD) | ||
.map { kitchen.take(it) } | ||
.toList() | ||
|
||
fun cookSmoothie(){ | ||
getFruitsForSmoothie().cookSmoothie() | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...erverAddSpices/src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/recipes/Salad.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.jetbrains.kotlin.course.culinary.game.recipes | ||
|
||
import org.jetbrains.kotlin.course.culinary.models.food.CutVegetable | ||
import org.jetbrains.kotlin.course.culinary.models.food.Vegetable | ||
|
||
const val NUM_VEGETABLES_FOR_SALAD = 5 | ||
|
||
fun getFreshVegetables(): List<Vegetable> = TODO("Not implemented yet") | ||
|
||
fun List<Vegetable>.cut(): List<CutVegetable> = TODO("Not implemented yet") | ||
|
||
fun mixVegetablesForSalad(cutVegetables: List<CutVegetable>) { | ||
TODO("Not implemented yet") | ||
} |
9 changes: 9 additions & 0 deletions
9
...erAddSpices/src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/recipes/Smoothie.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.jetbrains.kotlin.course.culinary.game.recipes | ||
|
||
import org.jetbrains.kotlin.course.culinary.models.food.Fruit | ||
|
||
fun getFruitsForSmoothie(): List<Fruit> = TODO("Not implemented yet") | ||
|
||
fun List<Fruit>.cookSmoothie() { | ||
TODO("Not implemented yet") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
...linaryServerAddSpices/src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/Task.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.jetbrains.kotlin.course.culinary.models | ||
|
||
enum class Task { | ||
SOUP, | ||
SALAD, | ||
SMOOTHIE, | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
type: edu | ||
custom_name: Master Chef - Add Spices | ||
files: | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/MasterChefApplication.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/GameResource.kt | ||
visible: false | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/GameService.kt | ||
visible: false | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/food/IngredientType.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/food/Ingredient.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/storage/Fridge.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/storage/Shelf.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/cooking/Pot.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/storage/Basket.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/cooking/SaladBowl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/cooking/Blender.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/implementation/storage/FridgeImpl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/implementation/storage/ShelfImpl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/implementation/cooking/PotImpl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/implementation/cooking/SaladBowlImpl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/Resettable.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/implementation/cooking/BlenderImpl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/Kitchen.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/implementation/KitchenImpl.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/GameEnviroment.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/GameActions.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/recipes/TomatoSoup.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/action/Action.kt | ||
visible: false | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/action/ActionType.kt | ||
visible: false | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/ItemType.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/converters/ItemTypeConverter.kt | ||
visible: false | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/models/Task.kt | ||
visible: false | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/recipes/Salad.kt | ||
visible: true | ||
- name: src/main/kotlin/org/jetbrains/kotlin/course/culinary/game/recipes/Smoothie.kt | ||
visible: true | ||
- name: test/FridgeImplTestClass.kt | ||
visible: false | ||
propagatable: false | ||
- name: test/Tests.kt | ||
visible: false | ||
propagatable: false | ||
- name: test/TomatoSoupFunctions.kt | ||
visible: false | ||
propagatable: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TODO: coding task, generateSpices and addSpices |
27 changes: 27 additions & 0 deletions
27
culinaryServer/culinaryServerAddSpices/test/FridgeImplTestClass.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import org.jetbrains.academy.test.system.core.models.TestKotlinType | ||
import org.jetbrains.academy.test.system.core.models.Visibility | ||
import org.jetbrains.academy.test.system.core.models.classes.ClassType | ||
import org.jetbrains.academy.test.system.core.models.classes.TestClass | ||
import org.jetbrains.academy.test.system.core.models.method.TestMethod | ||
|
||
internal val generateRandomVegetablesMethod = TestMethod( | ||
"generateRandomVegetables", | ||
TestKotlinType("List", params = listOf("org.jetbrains.kotlin.course.culinary.ingredient.Vegetable")), | ||
visibility = Visibility.PRIVATE, | ||
) | ||
|
||
internal val refillMethod = TestMethod( | ||
"refill", | ||
TestKotlinType("Unit"), | ||
returnTypeJava = "void", | ||
) | ||
|
||
internal val fridgeImplTestClass = TestClass( | ||
"FridgeImpl", | ||
"org.jetbrains.kotlin.course.culinary.implementation.storage", | ||
classType = ClassType.OBJECT, | ||
customMethods = listOf( | ||
generateRandomVegetablesMethod, | ||
refillMethod | ||
), | ||
) |
Oops, something went wrong.