public void SetNeighbor(StartTopHexDir direction, List <Coordinates> coords, Coordinates cell) { _neighborIndexes[(int)direction] = new Neighbor(direction.ToString(), coords.IndexOf(cell)); //, cell); var opposite = direction.Opposite(); cell._neighborIndexes[(int)opposite] = new Neighbor(opposite.ToString(), coords.IndexOf(this)); //, this); }
public static StartTopHexDir Opposite(this StartTopHexDir direction) { return((int)direction < 3 ? (direction + 3) : (direction - 3)); }