I've been having an issue figuring out how I can search arround a coordinate to find its neighbours. It will make more sense when you see the picture.
I have 7 hexagons and they all have respective coordinates where the center one is (0,0). I wish to create a method in which I can add all neighbour hexagons to an arraylist, but I'm having a difficult time figuring out how I can determine that the added hexagon is in fact an neighbour.
Example: (Reference to picture)
I wish to know which neighbours the hexagon on position (0,-1) has. By looking at the picture I can see it has (1,0) , (0,0) and (-1,-1). But how would I loop through this and find its neighbours in java code?