How to store field of hexagons

Hello everybody!

I’m working on a game that would look like Dicewars and my question is how to properly store field of hexagons.

I think it should look like matrix of values. Every value means whether hexagon relate to the certain player who owns it. Also each hexagon is a part of an area that can be conquered so it seems to be important to store relation of hexagon to the particular area.

Maybe there are any other better ways to do the same or kind of improvement.

OK, that’s what I did and what suits my project:

// number represents belonging to certain zone
public static int[] array_of_hexagons = new int[] { 0, 0, 1
                                                    0, 1, 1
                                                    2, 2, 2 };

// array index is a zone
// array value is player's number
public static int[] belonging_to_player = new int[] {1, 2, 0};

// this means that zone 0 owner is Player 1,
// zone 1 owner is Player 2,
// and zone 2 isn't conquered by any player so far.