Skip to content

Commit

Permalink
Allow comma separated parameters for random methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-wilke committed Apr 4, 2020
1 parent 3455fa6 commit 1c9642a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/de/gurkenlabs/litiengine/GameRandom.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public <T> T choose(T[] array) {
* @throws IllegalArgumentException
* When the specified array is null or empty.
*/
public int choose(int[] array) {
public int choose(int... array) {
if (array == null || array.length == 0) {
throw new IllegalArgumentException(ARRAY_MUST_NOT_BE_EMPTY);
}
Expand All @@ -132,7 +132,7 @@ public int choose(int[] array) {
* @throws IllegalArgumentException
* When the specified array is null or empty.
*/
public long choose(long[] array) {
public long choose(long... array) {
if (array == null || array.length == 0) {
throw new IllegalArgumentException(ARRAY_MUST_NOT_BE_EMPTY);
}
Expand All @@ -150,7 +150,7 @@ public long choose(long[] array) {
* @throws IllegalArgumentException
* When the specified array is null or empty.
*/
public double choose(double[] array) {
public double choose(double... array) {
if (array == null || array.length == 0) {
throw new IllegalArgumentException(ARRAY_MUST_NOT_BE_EMPTY);
}
Expand Down

0 comments on commit 1c9642a

Please sign in to comment.