* GUI: new reworked GUI and card render engine, card icons and dozens of other fixes (see full list in related PR);

This commit is contained in:
Oleg Agafonov 2021-01-30 16:38:55 +04:00
parent df98cc3e62
commit a1da5ef437
304 changed files with 7266 additions and 5093 deletions

View file

@ -0,0 +1,69 @@
package mage.players;
import mage.abilities.ActivatedAbility;
import mage.util.Copyable;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* Contains stats with all playable cards for the player
*
* @author JayDi85
*/
public class PlayableObjectsList implements Serializable, Copyable<PlayableObjectsList> {
Map<UUID, PlayableObjectStats> objects = new HashMap<>();
public PlayableObjectsList() {
}
public PlayableObjectsList(Map<UUID, List<ActivatedAbility>> playableObjects) {
load(playableObjects);
}
public PlayableObjectsList(final PlayableObjectsList source) {
source.objects.entrySet().forEach(entry -> {
this.objects.put(entry.getKey(), entry.getValue().copy());
});
}
@Override
public PlayableObjectsList copy() {
return new PlayableObjectsList(this);
}
public void load(Map<UUID, List<ActivatedAbility>> playableObjects) {
objects.clear();
playableObjects.forEach((objectId, list) -> {
objects.put(objectId, new PlayableObjectStats(list));
});
}
public boolean containsObject(UUID objectId) {
return objects.containsKey(objectId);
}
public boolean isEmpty() {
return objects.isEmpty();
}
public PlayableObjectStats getStats(UUID objectId) {
if (objects.containsKey(objectId)) {
return objects.get(objectId).copy();
} else {
return new PlayableObjectStats();
}
}
public int getPlayableAmount(UUID objectId) {
if (objects.containsKey(objectId)) {
return objects.get(objectId).getPlayableAmount();
} else {
return 0;
}
}
}