maptool

package
v0.0.0-...-7787783 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMap

func CreateMap(size domain.FieldSize, zero domain.Cell) [][]domain.Cell

func IterateCustom

func IterateCustom(size domain.FieldSize, dir domain.Pair, callback func(pair domain.Pair))

func IterateX

func IterateX(start, end, shiftDir int, callback func(int))

func ShiftDir

func ShiftDir(size domain.FieldSize, f [][]domain.Cell, dir domain.Pair, fill domain.Cell)

Types

type Distribution

type Distribution map[domain.ObjectID][]domain.CellWithLocation

func DistributeMap

func DistributeMap(size domain.FieldSize, f [][]domain.Cell) Distribution

DistributeMap returns map from id to shuffled cells. Considered slow.

type FastMap

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

func NewFastMap

func NewFastMap(size domain.FieldSize, zero domain.Cell) *FastMap

func (*FastMap) AnyRandom

func (f *FastMap) AnyRandom(ids ...domain.ObjectID) (domain.Pair, bool)

func (*FastMap) Count

func (f *FastMap) Count(id domain.ObjectID) int

func (*FastMap) Field

func (f *FastMap) Field() [][]domain.Cell

func (*FastMap) Get

func (f *FastMap) Get(p domain.Pair) domain.Cell

func (*FastMap) PurgeFastUpdate

func (f *FastMap) PurgeFastUpdate() []proto.UpdateCell

func (*FastMap) Set

func (f *FastMap) Set(p domain.Pair, cell domain.Cell)

type RandomSet

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

func NewRandomSet

func NewRandomSet() *RandomSet

func (*RandomSet) Add

func (s *RandomSet) Add(cell domain.CellWithLocation)

func (*RandomSet) Len

func (s *RandomSet) Len() int

func (*RandomSet) PurgeAll

func (s *RandomSet) PurgeAll() []domain.CellWithLocation

func (*RandomSet) Random

func (s *RandomSet) Random() (domain.CellWithLocation, bool)

func (*RandomSet) Remove

func (s *RandomSet) Remove(cell domain.CellWithLocation)

Jump to

Keyboard shortcuts

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