Canning isOwnerOfAll() and isMemberOfAll() of ApplicableRegionSet.

This commit is contained in:
sk89q 2012-11-17 16:46:31 -08:00
parent e0ab79bd36
commit 129412ba79

View File

@ -108,39 +108,6 @@ public boolean allows(StateFlag flag, LocalPlayer player) {
return internalGetState(flag, null, player);
}
/**
* Indicates whether a player is an owner of all regions in this set.
*
* @param player player
* @return whether the player is an owner of all regions
*/
public boolean isOwnerOfAll(LocalPlayer player) {
for (Region region : applicable) {
if (!region.isOwner(player)) {
return false;
}
}
return true;
}
/**
* Indicates whether a player is an owner or member of all regions in
* this set.
*
* @param player player
* @return whether the player is a member of all regions
*/
public boolean isMemberOfAll(LocalPlayer player) {
for (Region region : applicable) {
if (!region.isMember(player)) {
return false;
}
}
return true;
}
/**
* Checks to see if a flag is permitted.
*
@ -395,6 +362,7 @@ public int size() {
/**
* Get an iterator of affected regions.
*/
@Override
public Iterator<Region> iterator() {
return applicable.iterator();
}