* rename CharacterState equals() -> same_variant()

This commit is contained in:
Adam Whitehurst 2020-03-22 05:46:09 -07:00
parent afa6e43dd5
commit db8d89a4d9
3 changed files with 12 additions and 12 deletions

View File

@ -393,7 +393,7 @@ impl Client {
{
if last_character_states
.get(entity)
.map(|l| !client_character_state.equals(&l.0))
.map(|l| !client_character_state.same_variant(&l.0))
.unwrap_or(true)
{
let _ = last_character_states

View File

@ -111,7 +111,7 @@ impl CharacterState {
}
/// Compares for shallow equality (does not check internal struct equality)
pub fn equals(&self, other: &Self) -> bool {
pub fn same_variant(&self, other: &Self) -> bool {
// Check if state is the same without looking at the inner data
std::mem::discriminant(self) == std::mem::discriminant(other)
}

View File

@ -418,7 +418,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -650,7 +650,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -730,7 +730,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -810,7 +810,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -884,7 +884,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -958,7 +958,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -1032,7 +1032,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -1106,7 +1106,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -1180,7 +1180,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}
@ -1254,7 +1254,7 @@ impl FigureMgr {
_ => continue,
};
if !character.equals(&last_character.0) {
if !character.same_variant(&last_character.0) {
state.state_time = 0.0;
}