diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java b/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java index c5c8409..c74f225 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java @@ -29,7 +29,7 @@ public class HellsBells { EAST(1, 0, 0, false), WEST(-1, 0, 0, false); - static final List DIRECTIONS = Arrays.asList(values()); + static final Direction[] DIRECTIONS = values(); int dx; int dy; @@ -43,6 +43,10 @@ public class HellsBells { this.zLength = zLength; } + public static Direction getRandom() { + return Direction.DIRECTIONS[random.nextInt(Direction.DIRECTIONS.length)]; + } + Direction other() { switch (this) { case NORTH: @@ -130,7 +134,7 @@ public class HellsBells { } public void drop() { - Direction direction = Direction.DIRECTIONS.get(random.nextInt(Direction.DIRECTIONS.size())); + Direction direction = Direction.getRandom(); AtomicInteger length = new AtomicInteger(10 + random.nextInt((direction.zLength ? zLength : xLength) - 10)); int width = 5 + random.nextInt(5);