add docs related to phasing methods, adjust method name

This commit is contained in:
xenohedron 2024-06-02 03:25:40 -04:00
parent 277e4f4311
commit 502ca34d14
2 changed files with 10 additions and 4 deletions

View file

@ -275,7 +275,10 @@ public class Battlefield implements Serializable {
}
}
public List<Permanent> getPhasedIn(Game game, UUID controllerId) {
/**
* Returns controlled permanents with phasing ability that are phased in, so that they can be phased out
*/
public List<Permanent> getPhasingOut(Game game, UUID controllerId) {
return field.values()
.stream()
.filter(perm -> perm.hasAbility(PhasingAbility.getInstance(), game)
@ -284,7 +287,10 @@ public class Battlefield implements Serializable {
.collect(Collectors.toList());
}
public List<Permanent> getPhasedOut(Game game, UUID controllerId) {
/**
* Returns controlled permanents that are phased out, so that they can be phased in
*/
public List<Permanent> getPhasedOut(UUID controllerId) {
return field.values()
.stream()
.filter(perm -> !perm.isPhasedIn() && perm.isControlledBy(controllerId))

View file

@ -1886,8 +1886,8 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public void phasing(Game game) {
//20091005 - 502.1
List<Permanent> phasedOut = game.getBattlefield().getPhasedOut(game, playerId);
for (Permanent permanent : game.getBattlefield().getPhasedIn(game, playerId)) {
List<Permanent> phasedOut = game.getBattlefield().getPhasedOut(playerId);
for (Permanent permanent : game.getBattlefield().getPhasingOut(game, playerId)) {
// 502.15i When a permanent phases out, any local enchantments or Equipment
// attached to that permanent phase out at the same time. This alternate way of
// phasing out is known as phasing out "indirectly." An enchantment or Equipment