Ejemplo n.º 1
0
//  This methods should be replaced.
func (h *Grid) GetVertices(coords hexcoords.Hex) []*Vertex {
	if !h.WithinBounds(coords) {
		return nil
	}
	var vertices = make([]*Vertex, 6)
	for _, v := range coords.Vertices(hex.NilDirection) {
		vertices[v.K] = h.GetVertex(v)
	}
	return vertices
}
Ejemplo n.º 2
0
func (h *Grid) GetEdges(coords hexcoords.Hex) []*Edge {
	if !h.WithinBounds(coords) {
		return nil
	}
	var edges = make([]*Edge, 6)
	for k, ec := range coords.Edges(hex.NilDirection) {
		edges[k] = h.GetEdge(ec)
	}
	return edges
}