feat: add portal support
This commit is contained in:
@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user