Coverage Summary for Class: Node (com.mygdx.game.AI)

Class Class, % Method, % Line, %
Node 100% (1/1) 100% (3/3) 100% (5/5)


1 package com.mygdx.game.AI; 2  3 import com.badlogic.gdx.math.Vector2; 4  5 /** 6  * A node in the A* pathfinding graph 7  */ 8 public class Node { 9  private final Vector2 position; 10  public float cost; 11  12  /** 13  * Position the node exists at 14  * @param x co-ord 15  * @param y co-ord 16  */ 17  public Node(float x, float y) { 18  position = new Vector2(x, y); 19  cost = -1; 20  } 21  22  /** 23  * Position the node exists at 24  * @return the position of the node 25  */ 26  public Vector2 getPosition() { 27  return position; 28  } 29  30  /** 31  * Sets position 32  * @param x co-ord 33  * @param y co-ord 34  */ 35  public void set(float x, float y) { 36  position.set(x, y); 37  } 38 }