Address review comments

This commit is contained in:
Imbris 2022-01-18 00:52:31 -05:00
parent 374bd10e5d
commit 3beb3c8205
3 changed files with 4 additions and 4 deletions

View File

@ -76,7 +76,7 @@ impl Energy {
/// So attempting to pass values that weren't returned from
/// [`Self::needs_maximum_update`] can produce strange or unexpected
/// results.
pub fn update_maximum(&mut self, maximum: u32) {
pub fn update_internal_integer_maximum(&mut self, maximum: u32) {
self.maximum = maximum;
// Clamp the current energy to enforce the current <= maximum invariant.
self.current = self.current.min(self.maximum);

View File

@ -112,7 +112,7 @@ impl Health {
/// So attempting to pass values that weren't returned from
/// [`Self::needs_maximum_update`] can produce strange or unexpected
/// results.
pub fn update_maximum(&mut self, maximum: u32) {
pub fn update_internal_integer_maximum(&mut self, maximum: u32) {
self.maximum = maximum;
// Clamp the current health to enforce the current <= maximum invariant.
self.current = self.current.min(self.maximum);

View File

@ -93,7 +93,7 @@ impl<'a> System<'a> for Sys {
let stat = stats;
if let Some(new_max) = health.needs_maximum_update(stat.max_health_modifiers) {
health.update_maximum(new_max);
health.update_internal_integer_maximum(new_max);
}
// Calculates energy scaling from stats and inventory
@ -104,7 +104,7 @@ impl<'a> System<'a> for Sys {
};
if let Some(new_max) = energy.needs_maximum_update(energy_mods) {
energy.update_maximum(new_max);
energy.update_internal_integer_maximum(new_max);
}
}