Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Lera_Rodina#45

Open
valeryrodina wants to merge 52 commits intomasterfrom
feature/Lera_Rodina
Open

Lera_Rodina#45
valeryrodina wants to merge 52 commits intomasterfrom
feature/Lera_Rodina

Conversation

@valeryrodina
Copy link
Collaborator

No description provided.

@valeryrodina valeryrodina changed the title Feature/lera rodina feature/lera rodina Jul 12, 2021
@valeryrodina valeryrodina added the readyForReview Sign for Artem to take a look label Jul 12, 2021
@valeryrodina valeryrodina changed the title feature/lera rodina lera rodina Jul 12, 2021
@valeryrodina valeryrodina force-pushed the feature/Lera_Rodina branch from f892119 to 103b908 Compare July 12, 2021 17:36
@valeryrodina valeryrodina changed the title lera rodina Lera Rodina Jul 12, 2021
@NikolaevArtem NikolaevArtem added bug Code fix needed and removed readyForReview Sign for Artem to take a look labels Jul 13, 2021
@valeryrodina valeryrodina force-pushed the feature/Lera_Rodina branch 6 times, most recently from a69770e to 9d48202 Compare July 13, 2021 19:07
@valeryrodina valeryrodina force-pushed the feature/Lera_Rodina branch from 9d48202 to 463cebd Compare July 13, 2021 19:09
@valeryrodina valeryrodina added the readyForReview Sign for Artem to take a look label Jul 13, 2021
@NikolaevArtem NikolaevArtem added HW_1 Good to go and removed bug Code fix needed readyForReview Sign for Artem to take a look labels Jul 15, 2021
@NikolaevArtem NikolaevArtem changed the title Lera Rodina Lera_Rodina Jul 15, 2021
vrodina added 2 commits September 21, 2021 20:11
Add course project without tests
@NikolaevArtem NikolaevArtem removed bug Code fix needed readyForReview Sign for Artem to take a look labels Sep 21, 2021
@@ -0,0 +1,30 @@

Course project SEA BATTLE
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good description!

}

shoot();
return false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the case when it will return false? Seems impossible

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check and fix if it is needed

}

shoot();
return false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: What's the case when it will return false? Seems impossible

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check and fix if it is needed

displayer.clearScreen();
displayer.displayMap(playerOne.getMap());
displayer.displayRadar(playerOne.getRadar());
if (playerOne.shoot()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look good... usually methods should follow Single Responsibility Prinsiple - it should do only one thing, the thing it promises. In this case it's unexpected it returns boolean.

Have you tried finishing the game? I'm not sure it will not go to an infinite loop of recursion

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're absolutely right. Seems that I forgot to add a condition for loop after last changes for this part:( Let me check


import java.io.IOException;

public class Game {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! You introduced some abstractions, showed knowledge of Java Core and Java libraries. The code in general looks good, but there are a few cases where I'm not sure about the correct behavior. Also, your project lacks abstract classes/interfaces, and some architecture (the simplest is service/model). The interface is cool, I like it. playing is quite comfortable) I also appreciate automatic ship placement and description, it really helps to test.

Approved!

import java.util.Objects;
import java.util.stream.Collectors;

public class ObjectToJsonConverter {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thorough example, good job!

import java.util.List;
import java.util.Scanner;

public class CustomFileReader {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opt: use try-with-resources, otherwise if you get an exception, stream will not be closed

Comment on lines +9 to +11
String file = "src/main/resources/custom_file_reader/fileTest.txt";
Path path = Paths.get("src/main/resources/custom_file_reader/fileTest.txt");
new CustomFileReader(path).run3();
Copy link
Owner

@NikolaevArtem NikolaevArtem Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opt: That's quite disturbing, I think Path creation could be done in methods that require it...




HashMap<MapProblemsMutableGenerator<String>, String> container_mutable_gen = new HashMap<>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no mutable key problem in your example
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

public class CustomFileReaderTest extends UnitBase {

@Test()
public void givenWrongFile_whenRun1_thenException() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test cases names!

Copy link
Owner

@NikolaevArtem NikolaevArtem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! The code is generally easy to read, thoroughly tested, has nice examples/description. Minor fixes requested for HW_3 and HW_6.

valeryrodina and others added 4 commits September 21, 2021 23:41
Co-authored-by: Artem Nikolaev <Nikolaev.artem.work@yandex.ru>
@valeryrodina valeryrodina added the readyForReview Sign for Artem to take a look label Sep 23, 2021
@NikolaevArtem NikolaevArtem added HW_3 HW_6 and removed readyForReview Sign for Artem to take a look labels Sep 23, 2021
Copy link
Owner

@NikolaevArtem NikolaevArtem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HW approved!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants