Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Territory$Point


    return t.getZmin();
  }

  public int getMaxZ(int terr)
  {
    L2Territory t = _locations.get(terr);
    if(t == null)
    {
      _log.warning("TerritoryTable.getMaxZ: territory " + terr + " not found.");
      return 0;
    }
    return t.getZmax();
  }
View Full Code Here


        }
        else
        {
          if(_locations.get(terr) == null)
          {
            L2Territory t = new L2Territory(terr);
            _locations.put(terr, t);
          }
          _locations.get(terr).add(rset.getInt("loc_x"), rset.getInt("loc_y"), rset.getInt("loc_zmin"), rset.getInt("loc_zmax"));
        }
      }
    }
    catch(Exception e1)
    {
      //problem with initializing spawn, go to next one
      _log.warning("locations couldnt be initialized:" + e1);
    }
    finally
    {
      DatabaseUtils.closeDatabaseCSR(con, statement, rset);
    }
    for(L2Territory t : _locations.values())
    {
      t.validate();
    }
    _log.info("TerritoryTable: Loaded " + _locations.size() + " locations");
  }
View Full Code Here

              }
              else if("shape".equalsIgnoreCase(e.getNodeName()) || "restart_point".equalsIgnoreCase(e.getNodeName()) || "PKrestart_point".equalsIgnoreCase(e.getNodeName()))
              {
                int locId = IdFactory.getInstance().getNextId();
                boolean isRound = !XMLUtil.getAttributeValue(e, "loc").isEmpty();
                L2Territory territory;
                if(isRound)
                {
                  String[] coord = XMLUtil.getAttributeValue(e, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll("  ", " ").trim().split(" ");
                  if(coord.length < 5) // Не указаны minZ и maxZ, берем граничные значения
                  {
                    territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.MIN_VALUE, Integer.MAX_VALUE);
                  }
                  else
                  {
                    territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]), Integer.parseInt(coord[4]));
                  }
                }
                else
                {
                  territory = new L2Territory(locId);
                  for(Node location = e.getFirstChild(); location != null; location = location.getNextSibling())
                  {
                    if("coords".equalsIgnoreCase(location.getNodeName()))
                    {
                      String[] coord = XMLUtil.getAttributeValue(location, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll("  ", " ").trim().split(" ");
                      if(coord.length < 4) // Не указаны minZ и maxZ, берем граничные значения
                      {
                        territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.MIN_VALUE, Integer.MAX_VALUE);
                      }
                      else
                      {
                        territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]));
                      }
                    }
                  }
                }
                if("shape".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setLoc(territory);
                  territory.setZone(z);
                  territory.validate();
                }
                else if("restart_point".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setRestartPoints(territory);
                }
View Full Code Here

   *            contains the client coordinates to be converted.
   * @return converted point of the sreen coordinates.
   */
  public static Point clientToScreen(int handle, Point point)
  {
    POINT pt = new POINT();
    pt.x = point.x;
    pt.y = point.y;
    OS.ClientToScreen(handle, pt);
    return new Point(pt.x, pt.y);
  }
View Full Code Here

   *            specifies the y-coordinate of the point
   * @return a handle to the window that contains the specified point
   */
  public static int getWindowFromPoint(int x, int y)
  {
    POINT point = new POINT();
    point.x = x;
    point.y = y;
    return Extension.WindowFromPoint(point);
  }
View Full Code Here

   *            screen coordinates.
   * @return converted point of the client-area coordinates.
   */
  public static Point screenToClient(int handle, Point point)
  {
    POINT pt = new POINT();
    pt.x = point.x;
    pt.y = point.y;
    OS.ScreenToClient(handle, pt);
    return new Point(pt.x, pt.y);
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Territory$Point

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.