Implemented Pir's Whim

Also added an object for choosing friend or foe
This commit is contained in:
Evan Kranzler 2018-05-23 11:57:49 -04:00
parent efa0cfdae9
commit 544563ae8b
3 changed files with 167 additions and 0 deletions

View file

@ -0,0 +1,51 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.choices;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public class ChooseFriendsAndFoes {
private List<Player> friends = new ArrayList<>();
private List<Player> foes = new ArrayList<>();
public boolean chooseFriendOrFoe(Player playerChoosing, Ability source, Game game) {
if (playerChoosing == null) {
return false;
}
friends.clear();
foes.clear();
for (UUID playerId : game.getState().getPlayersInRange(playerChoosing.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
if (playerChoosing.chooseUse(Outcome.Vote, "Is " + player.getName() + " friend or foe?", null, "Friend", "Foe", source, game)) {
friends.add(player);
} else {
foes.add(player);
}
}
}
return true;
}
public List<Player> getFriends() {
return friends;
}
public List<Player> getFoes() {
return foes;
}
}