mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 01:22:54 +00:00
Use Lombok's EqualsAndHashCode
for comparing scene regions
This commit is contained in:
parent
45f4a9233d
commit
780674e8de
@ -2,10 +2,12 @@ package emu.grasscutter.scripts.data;
|
||||
|
||||
import emu.grasscutter.scripts.constants.ScriptRegionShape;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import java.util.List;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
import java.util.List;
|
||||
|
||||
@Setter @EqualsAndHashCode
|
||||
public class SceneRegion {
|
||||
public int config_id;
|
||||
public int shape;
|
||||
@ -18,6 +20,7 @@ public class SceneRegion {
|
||||
public float height;
|
||||
public List<Position> point_array;
|
||||
|
||||
@EqualsAndHashCode.Exclude
|
||||
public transient SceneGroup group;
|
||||
|
||||
/**
|
||||
@ -42,21 +45,4 @@ public class SceneRegion {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if two regions are the same.
|
||||
*
|
||||
* @param region The region to compare to.
|
||||
* @return True if the regions are the same, false otherwise.
|
||||
*/
|
||||
public boolean equals(SceneRegion region) {
|
||||
return this.config_id == region.config_id
|
||||
&& this.shape == region.shape
|
||||
&& this.pos.equals(region.pos)
|
||||
&& this.size.equals(region.size)
|
||||
&& this.radius == region.radius
|
||||
&& this.area_id == region.area_id
|
||||
&& this.height == region.height
|
||||
&& this.point_array.equals(region.point_array);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user