feat: add portal support

This commit is contained in:
2021-06-24 22:07:40 +02:00
parent 7b1ce8af8f
commit be7dd1ca94
10 changed files with 127 additions and 15 deletions

View File

@ -0,0 +1,46 @@
package uulm.teamname.marvelous.gamelibrary.entities;
import uulm.teamname.marvelous.gamelibrary.IntVector2;
import java.util.Objects;
/** Represents a portal on the map. */
public class Portal extends Entity {
/**
* Constructs a new {@link Portal}.
* @param id The {@link EntityID} of the portal
* @param position The position of the portal
*/
public Portal(EntityID id, IntVector2 position) {
super(id, position);
solid = false;
opaque = true;
}
@Override
public Portal clone() {
return new Portal(id, position);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
return "Portal{" +
"position=" + position +
'}';
}
}