spot

package
v0.0.0-...-fee577c Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spot

type Spot struct {
	sync.RWMutex

	Id uuid.UUID

	Position        s2.LatLng
	RadiusInM       float32
	ScanPeriod      time.Duration
	ZonePeriod      time.Duration
	SessionDuration time.Duration

	// Map with players in spot
	PlayersList *player_list.PlayerList
	// Channel for sending players list on update
	PlayersListBroadcaster *broadcast.Broadcaster

	Session *spot_session.SpotSession
	// contains filtered or unexported fields
}

func NewSpot

func NewSpot(position s2.LatLng, radiusInM float32, scanPeriod time.Duration, zonePeriod time.Duration, sessionDuration time.Duration) *Spot

func (*Spot) Close

func (s *Spot) Close()

TODO Use when all players leave spot

type SpotMap

type SpotMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSpotMap

func NewSpotMap() *SpotMap

func (*SpotMap) Delete

func (m *SpotMap) Delete(key uuid.UUID)

func (*SpotMap) Load

func (m *SpotMap) Load(key uuid.UUID) (value *Spot, ok bool)

func (*SpotMap) Store

func (m *SpotMap) Store(key uuid.UUID, value *Spot)

Jump to

Keyboard shortcuts

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