cleanup: optimize imports, remove unused code, fix warnings

This commit is contained in:
2021-06-01 19:26:29 +02:00
parent 4d467d6d95
commit e88476eb10
9 changed files with 33 additions and 27 deletions

View File

@ -12,9 +12,6 @@ import java.util.Objects;
@JsonDeserialize(using = EntityDeserializer.class)
@JsonSerialize(using = EntitySerializer.class)
public abstract class Entity {
/** Whether or not the entity is currently active in the game */
protected boolean active = true;
/** Whether or not the entity blocks movement */
protected boolean solid = false;
@ -43,10 +40,6 @@ public abstract class Entity {
*/
public abstract Entity clone();
public boolean isActive() {
return active;
}
public boolean blocksMovement() {
return solid;
}
@ -55,10 +48,6 @@ public abstract class Entity {
return opaque;
}
public void setActive(boolean active) {
this.active = active;
}
public IntVector2 getPosition() {
return position;
}
@ -72,12 +61,12 @@ public abstract class Entity {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Entity entity = (Entity) o;
return active == entity.active && Objects.equals(position, entity.position) && Objects.equals(id, entity.id);
return Objects.equals(position, entity.position) && Objects.equals(id, entity.id);
}
@Override
public int hashCode() {
return Objects.hash(active, position, id);
return Objects.hash(position, id);
}
}