What the guys mean is, implement the strategy pattern and make the A* Algorithm a concrete strategy. This way you can easily implement new Pathfinding algorithms without having to change your current code. (http://en.wikipedia.org/wiki/Strategy_pattern
). You'll have to define a method in your interface which you then override in the concrete subclasses (one of which is AStarPathfinder, other could be something like a hillclimbing algorithm (http://en.wikipedia.org/wiki/Hill_climbing
), and so on).
For the pathNode in A* you will have to divide the cost of the node into heuristic cost and movement cost.
The formula for calculating the total cost is this; F = G + H
G = the movement cost to move from the starting point A to a given node on the grid, following the path generated to get there.
H = the estimated movement cost or heuristic cost to move from that given node on the grid to the final destination, point B.
F = total cost = movementCost + heuristicCost.
As i said, total cost is something you can calculate so you dont include that into the model itself. You can also think of storing the x and y position in a Dimension, but that is personal preference