Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Landmark
- {
- private int m_iX; // x coordinate.
- private int m_iY; // y coordinate.
- private String m_strName; // Landmark name.
- /**
- * Constructor.
- * @param iX X coordinate
- * @param iY Y coordinate
- * @param strName Landmark name
- */
- public Landmark(int iX, int iY, String strName)
- {
- m_iX = iX;
- m_iY = iY;
- m_strName = strName;
- }
- /**
- * Return the x coordinate of this landmark.
- * @return x coordinate.
- */
- public int getX()
- {
- return m_iX;
- }
- /**
- * Returns the y coordinate of this landmark.
- * @return y coordinate.
- */
- public int getY()
- {
- return m_iY;
- }
- /**
- * Returns the landmark name.
- * @return Landmark name.
- */
- public String getName()
- {
- return m_strName;
- }
- /**
- * Does this landmark live on the supplied coordinate?
- * @param x X coordinate.
- * @param y Y coordinate.
- * @return
- */
- public boolean Intersects(int x, int y)
- {
- return (x == m_iX && y == m_iY);
- }
- }
Add Comment
Please, Sign In to add comment