-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hometask 2 #2
base: master
Are you sure you want to change the base?
Hometask 2 #2
Conversation
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.
См. комментарии по 1му дз в #1. Поправьте их в той или в этой ветке сначала (здесь они не исправлены).
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.
Перечитайте дз 2, важная часть - внутренний итератор, сейчас его нет.
} | ||
|
||
for (Room room : smartHome.getRooms()) { | ||
for (Light light : room.getLights()) { |
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.
Этот цикл должен быть заменен на внутренний итератор по 2му заданию. Вся итерацию должны делать объекты дома, а не кто-то со стороны. Исправьте.
package ru.sbt.mipt.oop; | ||
|
||
public interface Actionable { | ||
String getId(); |
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.
Нарушение SRP - единственная ответственность - execute(Action action)
. Исправьте.
if (!isDoorEvent(event)) { | ||
return; | ||
} | ||
for (Room room : smartHome.getRooms()) { |
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.
Перенести цикл внутрь объектов дома.
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.
skypeforlinux-64.deb - что этот 75 мегабайтный файл делает в проекте?
@@ -21,4 +22,9 @@ public void addRoom(Room room) { | |||
public Collection<Room> getRooms() { |
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.
Этого метода не должно быть - вся итерация внутри void execute(Action action).
@@ -24,4 +24,9 @@ public Room(Collection<Light> lights, Collection<Door> doors, String name) { | |||
public String getName() { | |||
return name; | |||
} | |||
|
|||
public void execute(Action action) { | |||
action.executeObj(this); |
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.
Где итерация по свету и дверям?
No description provided.