Package games.stendhal.server.core.pathfinder

Examples of games.stendhal.server.core.pathfinder.Node


    final SpeakerNPC mermaid = new SpeakerNPC("Nicklesworth") {

      @Override
      protected void createPath() {
        final List<Node> nodes = new LinkedList<Node>();
        nodes.add(new Node(8, 92));
        nodes.add(new Node(9, 92));       
        nodes.add(new Node(9, 93));
        nodes.add(new Node(11, 93));
        nodes.add(new Node(11, 94));
        nodes.add(new Node(13, 94));
        nodes.add(new Node(13, 96));
        nodes.add(new Node(14, 96));
        nodes.add(new Node(14, 98));
        nodes.add(new Node(16, 98));       
        nodes.add(new Node(16, 97));
        nodes.add(new Node(15, 97));
        nodes.add(new Node(15, 95));
        nodes.add(new Node(14, 95));
        nodes.add(new Node(14, 94));
        nodes.add(new Node(13, 94));
        nodes.add(new Node(13, 93));
        nodes.add(new Node(12, 93));
        nodes.add(new Node(12, 92));
        nodes.add(new Node(10, 92));
        nodes.add(new Node(10, 91));
        nodes.add(new Node(9, 91));
        nodes.add(new Node(9, 82));
        nodes.add(new Node(8, 82));
        setPath(new FixedPath(nodes, true));

      }

      @Override
View Full Code Here


      setEntityClass("angelnpc");
      setPosition(x, y);
      initHP(100);

      final List<Node> nodes = new LinkedList<Node>();
      nodes.add(new Node(x, y));
      nodes.add(new Node(x - 2, y));
      nodes.add(new Node(x - 2, y - 2));
      nodes.add(new Node(x, y - 2));
      setPath(new FixedPath(nodes, true));
    }
View Full Code Here

  /**
   * Plan a new path to the old destination.
   */
  public void reroute() {
    if (hasPath()) {
      Node node = guide.path.getDestination();
      final List<Node> path = Path.searchPath(this, node.getX(), node.getY());

      if (path.size() >= 1) {
        setPath(new FixedPath(path, false));
      } else {
        /*
 
View Full Code Here

      final String s = ctx.getString("node" + i, null);
      if (s != null) {
        final String[] coords = s.split(",");
        final int x = Integer.parseInt(coords[0]);
        final int y = Integer.parseInt(coords[1]);
        final Node node = new Node(x, y);
        result.add(node);
        i++;
      } else {
        lastNode = true;
      }
View Full Code Here

    final int dist2_1 = distance + distance + 1;
    final int dx = Rand.rand(dist2_1) - distance;
    final int dy = Rand.rand(dist2_1) - distance;

    final List<Node> path = new ArrayList<Node>(1);
    path.add(new Node(x + dx, y + dy));

    setPath(new FixedPath(path, false));
  }
View Full Code Here

    final SpeakerNPC groundskeeperNPC = new SpeakerNPC("Morgrin") {

      @Override
      protected void createPath() {
        final List<Node> nodes = new LinkedList<Node>();
        nodes.add(new Node(35, 13));
        nodes.add(new Node(35, 7));
        nodes.add(new Node(34, 7));
        nodes.add(new Node(34, 4));
        nodes.add(new Node(30, 4));
        nodes.add(new Node(30, 14));
        nodes.add(new Node(32, 14));
        nodes.add(new Node(32, 13));
        setPath(new FixedPath(nodes, true));
      }

      @Override
      protected void createDialog() {
View Full Code Here

    final SpeakerNPC trader = new SpeakerNPC("Wrvil") {

      @Override
      protected void createPath() {
        final List<Node> nodes = new LinkedList<Node>();
        nodes.add(new Node(4, 4));
        nodes.add(new Node(4, 9));
        nodes.add(new Node(12, 9));
        nodes.add(new Node(12, 4));
        setPath(new FixedPath(nodes, true));
      }

      @Override
      protected void createDialog() {
View Full Code Here

    npc = new SpeakerNPC("Susi") {

      @Override
      protected void createPath() {
        final List<Node> nodes = new LinkedList<Node>();
        nodes.add(new Node(4, 17));
        nodes.add(new Node(4, 27));
        nodes.add(new Node(7, 27));
        nodes.add(new Node(7, 17));
        setPath(new FixedPath(nodes, true));

      }

      @Override
View Full Code Here

  private void addNPC() {
    npc = new SpeakerNPC("Maltos") {
      @Override
      protected void createPath() {
        final List<Node> nodes = new LinkedList<Node>();
        nodes.add(new Node(88, 119));
        nodes.add(new Node(88, 117));
        nodes.add(new Node(84, 117));
        nodes.add(new Node(84, 121));
        nodes.add(new Node(86, 121));
        nodes.add(new Node(84, 121));
        nodes.add(new Node(84, 124));
        nodes.add(new Node(88, 124));
        nodes.add(new Node(88, 123));
        nodes.add(new Node(88, 124));
        nodes.add(new Node(91, 124));
        nodes.add(new Node(91, 121));
        nodes.add(new Node(90, 121));
        nodes.add(new Node(91, 121));
        nodes.add(new Node(91, 117));
        nodes.add(new Node(88, 117));
        setPath(new FixedPath(nodes, true));
      }

      @Override
      protected void createDialog() {
View Full Code Here

  }

  @Override
  protected void createPath() {
    final List<Node> nodes = new LinkedList<Node>();
    nodes.add(new Node(55, 94));
    nodes.add(new Node(93, 94));
    nodes.add(new Node(93, 73));
    nodes.add(new Node(107, 73));
    nodes.add(new Node(107, 35));
    nodes.add(new Node(84, 35));
    nodes.add(new Node(84, 20));
    nodes.add(new Node(17, 20));
    nodes.add(new Node(17, 82));
    nodes.add(new Node(43, 82));
    nodes.add(new Node(43, 94));
    setPath(new FixedPath(nodes, true));
  }
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.pathfinder.Node

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.