don't allow duplicate tiles with different names
This commit is contained in:
parent
e6f5e6e953
commit
d7529387ea
|
@ -12,8 +12,6 @@ pub struct Tile {
|
||||||
|
|
||||||
impl PartialEq for Tile {
|
impl PartialEq for Tile {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
self.name == other.name
|
|
||||||
&&
|
|
||||||
self.wall == other.wall
|
self.wall == other.wall
|
||||||
&&
|
&&
|
||||||
self.animation_frames == other.animation_frames
|
self.animation_frames == other.animation_frames
|
||||||
|
@ -144,5 +142,7 @@ mod test {
|
||||||
let mut tile_b = crate::mock::tile_default();
|
let mut tile_b = crate::mock::tile_default();
|
||||||
tile_b.id = "0".to_string();
|
tile_b.id = "0".to_string();
|
||||||
assert_eq!(tile_a, tile_b);
|
assert_eq!(tile_a, tile_b);
|
||||||
|
tile_b.name = None;
|
||||||
|
assert_eq!(tile_a, tile_b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue