Fixes getNeighbourhood counting corners twice
This commit is contained in:
@ -6,8 +6,16 @@ import inf101.v18.rogue101.objects.IItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Chest implements IContainer {
|
||||
private List<IItem> container = new ArrayList<>();
|
||||
public class Chest implements IContainer, IStatic {
|
||||
private List<IItem> container;
|
||||
|
||||
public Chest() {
|
||||
this.container = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Chest(List<IItem> items) {
|
||||
this.container = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItem get(int i) {
|
||||
@ -16,7 +24,7 @@ public class Chest implements IContainer {
|
||||
|
||||
@Override
|
||||
public List getContent() {
|
||||
return null;
|
||||
return container;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -29,11 +37,6 @@ public class Chest implements IContainer {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefence() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxHealth() {
|
||||
return 0;
|
||||
@ -44,6 +47,11 @@ public class Chest implements IContainer {
|
||||
return "Chest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInteractMessage() {
|
||||
return "Items in " + getName() + ": ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return 10000;
|
||||
|
22
src/inf101/v18/rogue101/items/IStatic.java
Normal file
22
src/inf101/v18/rogue101/items/IStatic.java
Normal file
@ -0,0 +1,22 @@
|
||||
package inf101.v18.rogue101.items;
|
||||
|
||||
import inf101.v18.rogue101.objects.IItem;
|
||||
|
||||
public interface IStatic extends IItem {
|
||||
@Override
|
||||
default int getDefence() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
default int getSize() {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
/**
|
||||
* A message to display when an interaction with the player happens.
|
||||
*
|
||||
* @return A message
|
||||
*/
|
||||
String getInteractMessage();
|
||||
}
|
Reference in New Issue
Block a user