fix: resolve various issues with ai, cloning and turn order handling
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
package uulm.teamname.marvelous.gamelibrary.entities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/** Represents an inventory of 6 slots of {@link StoneType StoneTypes} that can be manipulated. */
|
||||
public class Inventory implements Iterable<StoneType> {
|
||||
@ -85,12 +82,12 @@ public class Inventory implements Iterable<StoneType> {
|
||||
* @return The array of stones the inventory has
|
||||
*/
|
||||
public StoneType[] getStonesAsArray() {
|
||||
var toReturn = new StoneType[content.size()];
|
||||
var iterator = content.iterator();
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
toReturn[i] = iterator.next();
|
||||
StoneType[] result = new StoneType[content.size()];
|
||||
int i = 0;
|
||||
for(StoneType stone: content) {
|
||||
result[i++] = stone;
|
||||
}
|
||||
return toReturn;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user