<commit_before>package edu.brown.cs.roguelike.engine.pathfinding;

public abstract class AStarNode<N extends AStarNode<N>> 
  extends GraphNode<N> implements Comparable<N> {
  
  private int fScore;
  private int gScore;
  
  public AStarNode() {
  }
  
  /**
   * Calculates an admissible heuristic estimate of getting
   * from this node to the goal node
   * @param goal
   * @return
   */
  protected abstract int getHScore(N goal);
  
  public void update(int gScore, N goal) {
    this.fScore = gScore + getHScore(goal);
    this.gScore = gScore;
  }
  
  public int getGScore() {
    return this.gScore;
  }
  
  /**
   * Calculate the distance between this node and a neighbor
   */
  public abstract int distance(N neighbor);

  public int compareTo(N node1) {
    return this.fScore - node1.fScore;
  }
  
}<commit_msg>Created a getter to avoid build issues with variable access.<commit_after>package edu.brown.cs.roguelike.engine.pathfinding;

public abstract class AStarNode<N extends AStarNode<N>> 
  extends GraphNode<N> implements Comparable<N> {
  
  private int fScore;
  private int gScore;
  
  public AStarNode() {
  }
  
  /**
   * Calculates an admissible heuristic estimate of getting
   * from this node to the goal node
   * @param goal
   * @return
   */
  protected abstract int getHScore(N goal);
  
  public void update(int gScore, N goal) {
    this.fScore = gScore + getHScore(goal);
    this.gScore = gScore;
  }
  
  public int getGScore() {
    return this.gScore;
  }

  public int getFScore() {
    return this.fScore;
  }
  
  /**
   * Calculate the distance between this node and a neighbor
   */
  public abstract int distance(N neighbor);

  public int compareTo(N node1) {
    return this.fScore - node1.getFScore();
  }
  
}
{'fraction_non_alphanumeric': 0.0911664779161948, 'fraction_numerical': 0.0022650056625141564, 'mean_word_length': 2.997737556561086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2564302', 'n_tokens_mistral': 593, 'n_tokens_neox': 570, 'n_words': 172}