|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrogue.Pt
public class Pt
Simple class defining point coordinate.
| Constructor Summary | |
|---|---|
Pt()
Default constructor - point at 0,0 |
|
Pt(int x,
int y)
Creates point with given x,y coordinates |
|
Pt(Pt other)
Creates a new point, just like the existing point |
|
| Method Summary | |
|---|---|
boolean |
adjacent(Pt other)
Tests whether this point is adjacent to other point |
int |
distance(Pt other)
Calculates distance from this point to other point |
boolean |
equals(Pt other)
Tests equality of points (same coordinates) |
void |
read(java.io.BufferedReader in)
Reads two lines of data - x-coord on first line, y-coord on second line |
void |
setPt(int x,
int y)
Change location of Pt |
int |
x()
Return x coord |
int |
y()
Return y coord |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Pt()
public Pt(Pt other)
other - Existing point
public Pt(int x,
int y)
x - X coordinatey - Y coordinate| Method Detail |
|---|
public boolean equals(Pt other)
other - Another point
public boolean adjacent(Pt other)
other - Another point
public void read(java.io.BufferedReader in)
in - BufferedReader connected to dungeon definition filepublic int distance(Pt other)
other - Another point
public void setPt(int x,
int y)
x - New x valuey - New y valuepublic int x()
public int y()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||