Skip to content

Conversation

@perehod93-qa
Copy link
Owner

No description provided.

this.foodAmount = Math.max(foodAmount, 0);
}

public boolean decreaseFood(int amount) {

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);
}
}

Choose a reason for hiding this comment

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

Пустая строка

System.out.println(name + " остался голодным. Недостаточно еды.");
}
}

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++;
}

Choose a reason for hiding this comment

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

Пустая строка

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