Documentation ¶
Index ¶
- func CreateMap(size domain.FieldSize, zero domain.Cell) [][]domain.Cell
- func IterateCustom(size domain.FieldSize, dir domain.Pair, callback func(pair domain.Pair))
- func IterateX(start, end, shiftDir int, callback func(int))
- func ShiftDir(size domain.FieldSize, f [][]domain.Cell, dir domain.Pair, fill domain.Cell)
- type Distribution
- type FastMap
- func (f *FastMap) AnyRandom(ids ...domain.ObjectID) (domain.Pair, bool)
- func (f *FastMap) Count(id domain.ObjectID) int
- func (f *FastMap) Field() [][]domain.Cell
- func (f *FastMap) Get(p domain.Pair) domain.Cell
- func (f *FastMap) PurgeFastUpdate() []proto.UpdateCell
- func (f *FastMap) Set(p domain.Pair, cell domain.Cell)
- type RandomSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IterateCustom ¶
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 (*FastMap) PurgeFastUpdate ¶
func (f *FastMap) PurgeFastUpdate() []proto.UpdateCell
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) PurgeAll ¶
func (s *RandomSet) PurgeAll() []domain.CellWithLocation
func (*RandomSet) Remove ¶
func (s *RandomSet) Remove(cell domain.CellWithLocation)
Click to show internal directories.
Click to hide internal directories.