package dungeonmania.entities.collectables;
import dungeonmania.entities.Entity;
import dungeonmania.entities.Player;
Copyright By PowCoder代写 加微信 powcoder
import dungeonmania.entities.inventory.InventoryItem;
import dungeonmania.map.GameMap;
import dungeonmania.util.Position;
public class Key extends Entity implements InventoryItem {
private int number;
public Key(Position position, int number) {
super(position);
this.number = number;
public boolean canMoveOnto(GameMap map, Entity entity) {
return true;
public void onOverlap(GameMap map, Entity entity) {
if (entity instanceof Player) {
if (!((Player) entity).pickUp(this)) return;
map.destroyEntity(this);
public void onMovedAway(GameMap map, Entity entity) {
public void onDestroy(GameMap gameMap) {
public int getnumber() {
return number;
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com