From ef3aeda0dcfcbef538cc9a911d16952bbd185aca Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Thu, 5 Jan 2012 21:06:40 +0100 Subject: [PATCH] Added vararg expand and contract overload to Region and AbstractRegion. --- .../sk89q/worldedit/regions/AbstractRegion.java | 12 ++++++++++++ .../java/com/sk89q/worldedit/regions/Region.java | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java b/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java index d8f3656c5..aa05321df 100644 --- a/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java @@ -33,6 +33,18 @@ public void setWorld(LocalWorld world) { this.world = world; } + public void expand(Vector... changes) throws RegionOperationException { + for (Vector change : changes) { + expand(change); + } + } + + public void contract(Vector... changes) throws RegionOperationException { + for (Vector change : changes) { + contract(change); + } + } + public void shift(Vector change) throws RegionOperationException { expand(change); contract(change); diff --git a/src/main/java/com/sk89q/worldedit/regions/Region.java b/src/main/java/com/sk89q/worldedit/regions/Region.java index 8eea7cdd7..2858b6f28 100644 --- a/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -80,6 +80,14 @@ public interface Region extends Iterable { */ public void expand(Vector change) throws RegionOperationException; + /** + * Expand the region. + * + * @param changes array/arguments with multiple related changes + * @throws RegionOperationException + */ + public void expand(Vector... changes) throws RegionOperationException; + /** * Contract the region. * @@ -88,6 +96,14 @@ public interface Region extends Iterable { */ public void contract(Vector change) throws RegionOperationException; + /** + * Contract the region. + * + * @param changes array/arguments with multiple related changes + * @throws RegionOperationException + */ + public void contract(Vector... changes) throws RegionOperationException; + /** * Shift the region. *