storage

package
v0.0.0-...-5e01725 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoStorage

type GeoStorage struct {
	// contains filtered or unexported fields
}

GeoStorage is a wrapper to add points based on lat/lon

func New

func New(latitude float64, longitude float64, store *Interface) GeoStorage

New creates a new GeoStorage centered around latitutude, longitude

func (*GeoStorage) AxialFromGeo

func (g *GeoStorage) AxialFromGeo(latitude, longitude float64) coordinate.Axial

AxialFromGeo gets an Axial coordinate from the difference the lat,lon center and the arg.

type Interface

type Interface interface {
	Get(coordinate.Interface) (interface{}, bool)
	Set(coordinate.Interface, interface{})
	//LinearInterpolation(coordinate.Interface) []coordinate.Interface
	Neighbors(coordinate.Interface) []coordinate.Interface
}

Interface defines the minimum information needed to be useful

type SimpleMap

type SimpleMap map[coordinate.Interface]interface{}

SimpleMap is a hashmap representation of a hexagonal grid

func NewSimpleMap

func NewSimpleMap() SimpleMap

NewSimpleMap makes a new simple map

func (SimpleMap) Get

func (s SimpleMap) Get(key coordinate.Interface) (interface{}, bool)

Get returns a the key associated with a coordinate, or the

func (SimpleMap) Neighbors

func (s SimpleMap) Neighbors(key coordinate.Interface) []coordinate.Interface

Neighbors returns the valid neighbors in a map

func (SimpleMap) Set

func (s SimpleMap) Set(key coordinate.Interface, value interface{})

Set associates a value with a coordinate

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL