]> cvs.zerfleddert.de Git - FreeShisen/blobdiff - src/de/cwde/freeshisen/Point.java
ready for release?
[FreeShisen] / src / de / cwde / freeshisen / Point.java
index fc3e971bd7c013d14dea7aa9d9f2d8052661bdf3..3a4a47deb8c21dbd136b9b48a53599c976781ec7 100644 (file)
@@ -2,29 +2,43 @@ package de.cwde.freeshisen;
 
 class Point {
        public Point(int i, int j) {
-               this.i=i;
-               this.j=j;
+               this.i = i;
+               this.j = j;
+       }
+
+       public Point(Point p) {
+               this.i = p.i;
+               this.j = p.j;
        }
 
        public boolean equals(Point p) {
-               return (i==p.i && j==p.j);
+               return (i == p.i && j == p.j);
+       }
+
+       public boolean equals(int myi, int myj) {
+               return (i == myi && j == myj);
        }
 
        public String toString() {
-               return "("+i+","+j+")";
+               return "(" + i + "," + j + ")";
+       }
+
+       public void set(int i, int j) {
+               this.i = i;
+               this.j = j;
        }
 
        public static Point fromString(String s) {
-               String[] ij=s.split(",",2);
-               int i=Integer.parseInt(ij[0]);
-               int j=Integer.parseInt(ij[1]);
-               return new Point(i,j);
+               String[] ij = s.split(",", 2);
+               int i = Integer.parseInt(ij[0]);
+               int j = Integer.parseInt(ij[1]);
+               return new Point(i, j);
        }
 
        public int i;
        public int j;
 
        public Point copy() {
-               return new Point(this.i,this.j);
+               return new Point(this.i, this.j);
        }
 }
Impressum, Datenschutz