player_state

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayerPublicState

type PlayerPublicState struct {
	PlayerUuid uuid.UUID
	Position   s2.LatLng
	Health     float32
}

type PlayerState

type PlayerState struct {
	Position s2.LatLng
	Health   float32
	// Flag shows status of non-hunter player
	// Will be true, if player was caught by hunter
	IsCaught bool

	// Channel for sending state about players states
	Broadcaster *broadcast.Broadcaster
}

func NewPlayerState

func NewPlayerState() *PlayerState

type PlayerStateMap

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

func NewPlayerStateMap

func NewPlayerStateMap() *PlayerStateMap

func (*PlayerStateMap) Delete

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

func (*PlayerStateMap) Load

func (m *PlayerStateMap) Load(key uuid.UUID) (value *PlayerState, ok bool)

func (*PlayerStateMap) Range

func (m *PlayerStateMap) Range(f func(k uuid.UUID, v *PlayerState))

func (*PlayerStateMap) Store

func (m *PlayerStateMap) Store(key uuid.UUID, value *PlayerState)

Jump to

Keyboard shortcuts

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