Conversation
…lianchik # Conflicts: # README.md # src/main/java/homework_1/Main.java
|
|
||
| public class Main { | ||
|
|
||
| public static void main(String[] args) { |
There was a problem hiding this comment.
Really nice game, well-done! Excellent architecture, model/service separation, easy to read code, pretty interface and a lot of options how to play. Also, you're showing good knowledge of Java Core and Java libraries, as well as following Code Conventions and creating proper application architecture. Special thanks for automatic ship placement :) Testing is also fine, as I understand testing of console application can be tough.
Good job, approved!
| Player player2 = players[1]; | ||
| boolean isGameOver = false; | ||
| while (!isGameOver) { | ||
| isGameOver = service.isGameOver(player1, player2, gameMode); |
There was a problem hiding this comment.
Opt: service.isGameOver has really unexpected nature - most of game logic is there, but actually, by name, it should only check isGameOver or not, nothing else. Better separate
| } | ||
|
|
||
| public List<String> getTasks() { | ||
| return tasks; |
There was a problem hiding this comment.
This line makes the object mutable
| Collections.copy(tasks, this.tasks); | ||
| } | ||
| if (age == null) { | ||
| age = this.getAge(); |
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class Main { |
| package homework_4.custom_annotation; | ||
|
|
||
| @Author | ||
| public class Book { |
|
|
||
| import static java.lang.System.lineSeparator; | ||
|
|
||
| public class CustomFileReader { |
| import java.util.HashMap; | ||
| import java.util.Map; | ||
|
|
||
| public class Main { |
|
|
||
| public static void main(String[] args) { | ||
| Kitten kitten = new Kitten("Kitty Tom", 1, 2); | ||
| Cat grownUpCat = kitten.grow(k -> new Cat(k.getName().replace("Kitty", "Big"), k.getAge() + 1, k.getWeight() * 2)); |
There was a problem hiding this comment.
Opt: you could also try type conversion (like, weight to size or smth like this). Means Kitten and Cat have different field by type



No description provided.