Updated 'StartNode' class.

Updated the 'StartNode' class by reverting all enumerations to its origin types in it.
This commit is contained in:
Daniel Grigencha
2024-12-02 16:25:33 +01:00
parent 6c136b78b8
commit 167d898a3c

View File

@@ -10,7 +10,7 @@ public class StartNode extends Node {
/**
* The color of the node.
*/
private int color;
private Color color;
/**
* Creates a new start node with the given color.
@@ -18,11 +18,11 @@ public class StartNode extends Node {
* @param color the color of the node
*/
public StartNode(Color color) {
this.color = color.ordinal();
this.color = color;
}
private StartNode() {
color = Color.NONE.ordinal();
color = Color.NONE;
}
/**
@@ -31,7 +31,7 @@ private StartNode() {
* @return the color of the node
*/
public Color getColor() {
return Color.values()[color];
return color;
}
/**
@@ -40,6 +40,6 @@ public Color getColor() {
* @param color the new color of the node
*/
public void setColor(Color color) {
this.color = color.ordinal();
this.color = color;
}
}