-
Notifications
You must be signed in to change notification settings - Fork 13
V.Sultanyarov HomeWork #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
akrasenkov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не описан интерфейс и не реализован "Экран". Так всё тоже работает, но в задании была запрошена его реализация.
src/edu/androidclub/Application.java
Outdated
| ) | ||
| .getName() // Получить имя предмета | ||
| );*/ | ||
| Item item ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По гайдлайнам Java, пробел перед ; не ставится. Кроме того, здесь можно строки Item item ; и item = itemBox.emit(new Coordinates(1, 1)); объединить в одну (необязательно, но так лучше).
src/edu/androidclub/Application.java
Outdated
| public static class Cola extends Item { | ||
| public Cola() { | ||
| super("Cola"); // Вызов конструктора класса-родителя (класса Item) | ||
| super("Cola",50); // Вызов конструктора класса-родителя (класса Item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробельчик после запятой.
src/edu/androidclub/Application.java
Outdated
| public static class Sprite extends Item { | ||
| public Sprite() { | ||
| super("Sprite"); | ||
| super("Sprite",55); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробел после запятой.
src/edu/androidclub/ProductsBox.java
Outdated
| Stack<Item> items = scheme.get(coordinates); | ||
| if(items.empty()){ | ||
| return false; | ||
| }else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробелы до и после else.
| if(items.empty()){ | ||
| return false; | ||
| }else{ | ||
| return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так тоже ничего, но в данном случае можно заменить ветвление на return !items.empty(); - "вернуть true если НЕ пусто".
src/edu/androidclub/Monitor.java
Outdated
| public class Monitor implements AppScreen { | ||
|
|
||
| public void printText(String text){ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Много отступов.
src/edu/androidclub/Application.java
Outdated
| item = itemBox.emit(new Coordinates(1, 1)); | ||
| System.out.println("| Выдан товар: " + item.getName() +" по цене - " + item.getCost() + "|"); // OK | ||
| Item item = itemBox.emit(new Coordinates(1, 1)); | ||
| monitor.printText("| Выдан товар: " + item.getName() +" по цене - " + item.getCost() +"|");// OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше вынести рамку в Monitor.
src/edu/androidclub/Application.java
Outdated
| Stack<Item> sprites = new Stack<>(); // 2 | ||
|
|
||
| //Создал монитор для вывода | ||
| Monitor monitor = new Monitor(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Абсолютно правильно. Можно также для нормализации сделать AppScreen monitor = new Monitor();. Надеюсь, суть такого финта прослеживается)
akrasenkov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рамки не перенесены в Monitor.
akrasenkov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рамки всё ещё не перенесены...
akrasenkov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
No description provided.