public static class PathManualTree.Node extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
accessible |
private ArrayList<PathManualTree.Node> |
children |
private float |
cost |
private PathManualTree.Node |
father |
private String |
name |
private StringBuilder |
step |
Constructor and Description |
---|
Node(String name,
float cost,
boolean accessible)
Constructor of the node.
|
Modifier and Type | Method and Description |
---|---|
private void |
addChild(PathManualTree.Node child)
Add a node as the child of a father node.
|
ArrayList<PathManualTree.Node> |
getChildren()
Return all of a node's children.
|
float |
getCost()
Get the cost of a node.
|
PathManualTree.Node |
getFather()
Get the father node of a certain node.
|
String |
getName()
Get the name of a node.
|
String |
getStep()
Get the actual step in which the algorithm is working right now.
|
boolean |
isAccessible()
Method to check if a certain tile (node) is accessible by the character.
|
void |
setAccessible(boolean accessible)
Set to a node the validation that it is accessible by the character.
|
void |
setCost(float cost)
Set a cost to a node.
|
void |
setFather(PathManualTree.Node father)
Set a node as a father of another certain node.
|
void |
setName(String name)
Set the name to a node.
|
void |
setStep(int step)
Set the atual step to a certain node.
|
private ArrayList<PathManualTree.Node> children
private PathManualTree.Node father
private StringBuilder step
private String name
private float cost
private boolean accessible
public Node(String name, float cost, boolean accessible)
name
- Name of the node.cost
- Cost of the node (from the tile configured by the user).accessible
- Whether the node is accessible or not by the character.public boolean isAccessible()
public void setAccessible(boolean accessible)
accessible
- Full the attribute.public ArrayList<PathManualTree.Node> getChildren()
private void addChild(PathManualTree.Node child)
child
- The node to be advocated as child.public PathManualTree.Node getFather()
public void setFather(PathManualTree.Node father)
father
- Father node.public String getStep()
public void setStep(int step)
step
- The value of the actual step.public String getName()
public void setName(String name)
name
- Name of the node.public float getCost()
public void setCost(float cost)
cost
- Cost to be put into the node.