package org.tournier.minecraftregionmanager;

public class AreaMark {
	// An area mark is defined by 6 items:
	private String worldName;
	private int x1, z1, x2, z2;
	private String areaName;
	
	// Constructor
    public AreaMark(String world, int cx1, int cz1, int cx2, int cz2, String name) {
        worldName = world;
        x1 = cx1;
        z1 = cz1;
        x2 = cx2;
        z2 = cz2;
        areaName = name;
    }
    
    public String getWorldName() {
    	return worldName;
    }
    
    public int getX1() {
    	return x1;
    }
    
    public int getZ1() {
    	return z1;
    }
    
    public int getX2() {
    	return x2;
    }
    
    public int getZ2() {
    	return z2;
    }
    
    public String getAreaName() {
    	return areaName;
    }
    
    public void setX2(int cx2) {
    	x2 = cx2;
    }
    
    public void setZ2(int cz2) {
    	z2 = cz2;
    }
    
    public void setAreaName(String name) {
    	areaName = name;
    }
    
    public int getAreaSize() {
    	return ((Math.abs(x2 - x1) + 1) * (Math.abs(z2 - z1) + 1));
    }
    
    public boolean contains(int cx, int cz) {
    	if (cx >= x1 && cx <= x2 && cz >= z1 && cz <= z2) {
        	return true;
    	} else {
        	return false;
    	}
    }
    
    public String printMark() {
    	String s = "";
    	
    	if (x1 < x2) {
        	s = worldName + ":" + x1 + "," + z1 + ":" + x2 + "," + z2 + ":"+ areaName + " (blocks " + (x1*16) + "," + (z1*16) + " to " + ((x2*16)+15) + "," + ((z2*16)+15) + ")";
    	} else {
        	s = worldName + ":" + x1 + "," + z1 + ":" + x2 + "," + z2 + ":"+ areaName + " (blocks " + (x2*16) + "," + (z2*16) + " to " + ((x1*16)+15) + "," + ((z1*16)+15) + ")";    		
    	}
    	return s;
    }
}

@@ -62,17 +62,18 @@
 AreaMark
- 
+%0D%0A
 %7B%0D%0A%09// A
@@ -287,32 +287,37 @@
 z2, String name)
+%0D%0A   
  %7B%0D%0A        worl
@@ -475,24 +475,29 @@
 tWorldName()
+%0D%0A   
  %7B%0D%0A    %09ret
@@ -547,16 +547,21 @@
  getX1()
+%0D%0A   
  %7B%0D%0A    
@@ -608,16 +608,21 @@
  getZ1()
+%0D%0A   
  %7B%0D%0A    
@@ -669,16 +669,21 @@
  getX2()
+%0D%0A   
  %7B%0D%0A    
@@ -730,16 +730,21 @@
  getZ2()
+%0D%0A   
  %7B%0D%0A    
@@ -800,16 +800,21 @@
 eaName()
+%0D%0A   
  %7B%0D%0A    
@@ -875,16 +875,21 @@
 int cx2)
+%0D%0A   
  %7B%0D%0A    
@@ -943,16 +943,21 @@
 int cz2)
+%0D%0A   
  %7B%0D%0A    
@@ -1021,16 +1021,21 @@
 ng name)
+%0D%0A   
  %7B%0D%0A    
@@ -1094,16 +1094,21 @@
 eaSize()
+%0D%0A   
  %7B%0D%0A    
@@ -1225,16 +1225,21 @@
  int cz)
+%0D%0A   
  %7B%0D%0A    
@@ -1288,18 +1288,16 @@
 z %3C= z2)
- %7B
 %0D%0A      
@@ -1314,32 +1314,28 @@
 true;%0D%0A    %09
-%7D 
 else
- %7B
 %0D%0A        %09r
@@ -1348,24 +1348,16 @@
 false;%0D%0A
-    %09%7D%0D%0A
     %7D%0D%0A 
@@ -1390,16 +1390,21 @@
 ntMark()
+%0D%0A   
  %7B%0D%0A    
@@ -1444,18 +1444,16 @@
 x1 %3C x2)
- %7B
 %0D%0A      
@@ -1631,16 +1631,12 @@
    %09
-%7D 
 else
- %7B
 %0D%0A  
@@ -1819,14 +1819,8 @@
 %09%09%0D%0A
-    %09%7D
 %0D%0A  

Update to v1.00