mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Implementing new function in all classes implementing Player
This commit is contained in:
parent
c5cedc2aba
commit
4057cc2859
4 changed files with 9 additions and 3 deletions
|
|
@ -2072,6 +2072,10 @@ public class TestPlayer implements Player {
|
||||||
return computerPlayer.searchLibrary(target, game, targetPlayerId, triggerEvents);
|
return computerPlayer.searchLibrary(target, game, targetPlayerId, triggerEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void lookAtAllLibraries(Ability source, Game game) {
|
||||||
|
computerPlayer.lookAtAllLibraries(source, game);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean flipCoin(Game game) {
|
public boolean flipCoin(Game game) {
|
||||||
return computerPlayer.flipCoin(game);
|
return computerPlayer.flipCoin(game);
|
||||||
|
|
|
||||||
|
|
@ -597,6 +597,9 @@ public class PlayerStub implements Player {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void lookAtAllLibraries(Ability source, Game game) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayLand() {
|
public boolean canPlayLand() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@ public interface Player extends MageItem, Copyable<Player> {
|
||||||
* @param game
|
* @param game
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean lookAtAllLibraries(Ability source, Game game);
|
void lookAtAllLibraries(Ability source, Game game);
|
||||||
|
|
||||||
boolean canPlayLand();
|
boolean canPlayLand();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2478,7 +2478,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean lookAtAllLibraries(Ability source, Game game) {
|
public void lookAtAllLibraries(Ability source, Game game) {
|
||||||
for(UUID playerId : game.getState().getPlayersInRange(this.getId(), game)){
|
for(UUID playerId : game.getState().getPlayersInRange(this.getId(), game)){
|
||||||
Player player = game.getPlayer(playerId);
|
Player player = game.getPlayer(playerId);
|
||||||
String playerName = this.getName().equals(player.getName()) ? "Your " : player.getName() + "'s ";
|
String playerName = this.getName().equals(player.getName()) ? "Your " : player.getName() + "'s ";
|
||||||
|
|
@ -2486,7 +2486,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
Cards cardsInLibrary = new CardsImpl(player.getLibrary().getTopCards(game, player.getLibrary().size()));
|
Cards cardsInLibrary = new CardsImpl(player.getLibrary().getTopCards(game, player.getLibrary().size()));
|
||||||
lookAtCards(playerName, cardsInLibrary, game);
|
lookAtCards(playerName, cardsInLibrary, game);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean handleLibraryCastableCards(Library library, Game game, UUID targetPlayerId) {
|
private boolean handleLibraryCastableCards(Library library, Game game, UUID targetPlayerId) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue