Package org.rsbot.client

Examples of org.rsbot.client.Node


    if (!ctx.game.isLoggedIn()) {
      return;
    }
    final FontMetrics metrics = render.getFontMetrics();
    for (final int element : ctx.client.getRSNPCIndexArray()) {
      final Node node = ctx.nodes.lookup(ctx.client.getRSNPCNC(), element);
      if (node == null || !(node instanceof RSNPCNode)) {
        continue;
      }
      final RSNPC npc = new RSNPC(ctx, ((RSNPCNode) node).getRSNPC());
      final Point location = ctx.calc.tileToScreen(npc.getLocation(), npc.getHeight() / 2);
View Full Code Here


    try {
      if (nc == null || nc.getBuckets() == null || id < 0) {
        return null;
      }

      final Node n = nc.getBuckets()[(int) (id & nc.getBuckets().length - 1)];
      for (Node node = n.getPrevious(); node != n; node = node.getPrevious()) {
        if (node.getID() == id) {
          return node;
        }
      }
    } catch (final Exception ignored) {
View Full Code Here

   */
  public RSNPC[] getAll(final Filter<RSNPC> filter) {
    final int[] indices = methods.client.getRSNPCIndexArray();
    final Set<RSNPC> npcs = new HashSet<RSNPC>();
    for (final int index : indices) {
      final Node node = methods.nodes.lookup(methods.client.getRSNPCNC(), index);
      if (node instanceof RSNPCNode) {
        final RSNPC npc = new RSNPC(methods, ((RSNPCNode) node).getRSNPC());
        if (npc != null && filter.accept(npc)) {
          npcs.add(npc);
        }
View Full Code Here

  public RSNPC getNearest(final Filter<RSNPC> filter) {
    int min = 20;
    RSNPC closest = null;
    final int[] indices = methods.client.getRSNPCIndexArray();
    for (final int index : indices) {
      final Node node = methods.nodes.lookup(methods.client.getRSNPCNC(), index);
      if (node instanceof RSNPCNode) {
        final RSNPC npc = new RSNPC(methods, ((RSNPCNode) node).getRSNPC());
        if (npc != null && filter.accept(npc)) {
          final int distance = methods.calc.distanceTo(npc);
          if (distance < min) {
View Full Code Here

   *
   * @return your current Familiar
   */
  public Familiar getFamiliar() {
    for (final int element : methods.client.getRSNPCIndexArray()) {
      final Node node = methods.nodes.lookup(methods.client.getRSNPCNC(), element);
      if (node == null || !(node instanceof RSNPCNode)) {
        continue;
      }
      final RSNPC npc = new RSNPC(methods, ((RSNPCNode) node).getRSNPC());
      if (npc.getInteracting() != null && npc.getInteracting().equals(methods.players.getMyPlayer())) {
View Full Code Here

    this.nodeDeque = nodeDeque;
  }

  public int size() {
    int size = 0;
    Node node = nodeDeque.getTail().getPrevious();
    while (node != nodeDeque.getTail()) {
      node = node.getPrevious();
      size++;
    }
    return size;
  }
View Full Code Here

    }
    return size;
  }

  public N getHead() {
    final Node node = nodeDeque.getTail().getNext();
    if (node == nodeDeque.getTail()) {
      current = null;
      return null;
    }
    current = node.getNext();
    return (N) node;
  }
View Full Code Here

    current = node.getNext();
    return (N) node;
  }

  public N getTail() {
    final Node node = nodeDeque.getTail().getPrevious();
    if (node == nodeDeque.getTail()) {
      current = null;
      return null;
    }
    current = node.getPrevious();
    return (N) node;
  }
View Full Code Here

    current = node.getPrevious();
    return (N) node;
  }

  public N getNext() {
    final Node node = current;
    if (node == nodeDeque.getTail()) {
      current = null;
      return null;
    }
    current = node.getNext();
    return (N) node;
  }
View Full Code Here

    final int interact = getAccessor().getInteracting();
    if (interact == -1) {
      return null;
    }
    if (interact < 32768) {
      final Node node = methods.nodes.lookup(methods.client.getRSNPCNC(), interact);
      if (node == null || !(node instanceof RSNPCNode)) {
        return null;
      }
      return new RSNPC(methods, ((RSNPCNode) node).getRSNPC());
    } else {
View Full Code Here

TOP

Related Classes of org.rsbot.client.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.