Skip to content

Sprint 7 solution in file manager#5

Open
n20va wants to merge 8 commits into
mainfrom
sprint_7-solution-in-file-manager
Open

Sprint 7 solution in file manager#5
n20va wants to merge 8 commits into
mainfrom
sprint_7-solution-in-file-manager

Conversation

@n20va
Copy link
Copy Markdown
Owner

@n20va n20va commented Jul 2, 2025

No description provided.

super.removeSubtaskById(id);
save();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

еще нужно переопределить методы массового удаления сущностей

task.setId(id);
return task;
case "EPIC":
Epic epic = new Epic(title, description);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

нужно добавить в эпик статус из файла

} catch (IOException e) {
throw new ManagerSaveException("Ошибка при загрузке данных из файла.", e);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Сейчас вычитанные из файла Эпики потеряли данные о привязанных к ним подзадачах. Чтобы наполнить внутреннее хранилище Эпиков (subtaskIds) нужно пройтись по всем подзадачам из хранилища subtasks, по значению epicId брать конкретный Эпик из хранилища epics и использовать метод addSubtask()

Comment thread src/manager/FileBackedTaskManager.java Outdated
case "EPIC":
Epic epic = new Epic(title, description);
epic.setId(id);
epic.setStatus(Status.NEW);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

а почему именно NEW? Нужно было передать тот статус, что получили из файла

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants