fix: resolve various issues with ai, cloning and turn order handling

This commit is contained in:
2021-06-05 04:00:25 +02:00
parent cd992b0fa6
commit f2a961d159
6 changed files with 50 additions and 37 deletions

View File

@ -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;
}
/**