Extracted an AbstractRegion class with some common functionality of all the region types.

This commit is contained in:
TomyLobo
2012-01-03 15:57:29 +01:00
parent 2cc0087524
commit 4d708a5003
4 changed files with 42 additions and 52 deletions

View File

@ -0,0 +1,34 @@
package com.sk89q.worldedit.regions;
import java.util.Iterator;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.LocalWorld;
public abstract class AbstractRegion implements Region {
/**
* Stores the world.
*/
protected LocalWorld world;
public AbstractRegion(LocalWorld world) {
this.world = world;
}
/**
* Get the iterator.
*
* @return iterator of points inside the region
*/
public Iterator<BlockVector> iterator() {
return new RegionIterator(this);
}
public LocalWorld getWorld() {
return world;
}
public void setWorld(LocalWorld world) {
this.world = world;
}
}