add isOwned and isControlled methods. remove some null-checks, remove some unnecessary casts

This commit is contained in:
igoudt 2018-07-04 14:24:11 +02:00
parent e46ad02918
commit 9f06046f22
464 changed files with 567 additions and 562 deletions

View file

@ -101,7 +101,7 @@ public class Library implements Serializable {
}
public void putOnTop(Card card, Game game) {
if (card.getOwnerId().equals(playerId)) {
if (card.isOwnedBy(playerId)) {
card.setZone(Zone.LIBRARY, game);
library.addFirst(card.getId());
} else {
@ -125,7 +125,7 @@ public class Library implements Serializable {
}
public void putOnBottom(Card card, Game game) {
if (card.getOwnerId().equals(playerId)) {
if (card.isOwnedBy(playerId)) {
card.setZone(Zone.LIBRARY, game);
library.remove(card.getId());
library.add(card.getId());