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

Class Class, % Method, % Line, %
Path 100% (1/1) 100% (4/4) 100% (6/6)


1 package com.mygdx.game.AI; 2  3 import com.badlogic.gdx.ai.pfa.Connection; 4  5 /** 6  * The path that exists between 2 nodes not bidirectional 7  */ 8 public class Path implements Connection<Node> { 9  Node from; 10  Node to; 11  12  /** 13  * Creates a path from F to T 14  * @param f the start Node 15  * @param t the end Node 16  */ 17  public Path(Node f, Node t) { 18  from = f; 19  to = t; 20  } 21  22  /** 23  * @return the cost of traveling the path 24  */ 25  @Override 26  public float getCost() { 27  return to.cost; 28  } 29  30  /** 31  * @return the start node of the path 32  */ 33  @Override 34  public Node getFromNode() { 35  return from; 36  } 37  38  /** 39  * @return the end node of the path 40  */ 41  @Override 42  public Node getToNode() { 43  return to; 44  } 45 }