L2ZoneForm.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.model.zone;
  16. /**
  17. * Abstract base class for any zone form
  18. *
  19. * @author durgus
  20. */
  21. public abstract class L2ZoneForm
  22. {
  23. public abstract boolean isInsideZone(int x, int y, int z);
  24. public abstract boolean intersectsRectangle(int x1, int x2, int y1, int y2);
  25. public abstract double getDistanceToZone(int x, int y);
  26. public abstract int getLowZ(); //Support for the ability to extract the z coordinates of zones.
  27. public abstract int getHighZ(); //New fishing patch makes use of that to get the Z for the hook
  28. //landing coordinates.
  29. protected boolean lineSegmentsIntersect(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2)
  30. {
  31. return java.awt.geom.Line2D.linesIntersect(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2);
  32. }
  33. }