-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson 4 #5
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?
Lesson 4 #5
Conversation
| this.foodAmount = Math.max(foodAmount, 0); | ||
| } | ||
|
|
||
| public boolean decreaseFood(int amount) { |
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.
Так а зачем boolean то. Не надо к миске привязываться. Надо к количеству еды, которое кот хочет есть привязываться и сравнивать это количество с наполнением в миске. Если этого наполнения не достаточно, то мы и пишем, что доложите еще еды. Идешь и добавляешь количество нужное в миску. А то что ты делаешь в этом методе не поддается логике )
| System.out.println("Добавлено " + amount + " еды. Сейчас в миске: " + foodAmount); | ||
| } | ||
| } | ||
|
|
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.
Пустая строка
| System.out.println(name + " остался голодным. Недостаточно еды."); | ||
| } | ||
| } | ||
|
|
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.
Пустая строка
| super(name, 500, 10); | ||
| dogsCount++; | ||
| } | ||
|
|
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.