Interface ISpiralNode
- Namespace
- WitShells.DesignPatterns
Contract for a node in a doubly-linked spiral layout list. Each node knows its neighbours, its index in the spiral, and its 2D grid coordinate.
public interface ISpiralNode
Properties
Coordinate
2D grid coordinate of this node (used for layout-driven positioning).
Vector2Int Coordinate { get; set; }
Property Value
- Vector2Int
GameObject
The GameObject backing this node.
GameObject GameObject { get; }
Property Value
- GameObject
Index
Zero-based index of this node in the spiral sequence.
int Index { get; }
Property Value
Next
The next node in the spiral chain (clockwise or counter-clockwise).
ISpiralNode Next { get; set; }
Property Value
Previous
The previous node in the spiral chain.
ISpiralNode Previous { get; set; }
Property Value
Methods
Initialize(Vector3, int)
Initialises this node's position and index within the spiral.
void Initialize(Vector3 position, int index)
Parameters
positionVector3Local position assigned to this node.
indexintZero-based index within the spiral.
UpdateCoordinate(Vector2Int)
Updates the node's logical coordinate (does not immediately change visual position).
void UpdateCoordinate(Vector2Int coordinate)
Parameters
coordinateVector2Int