battle

package
v0.0.0-...-71ffa5d Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battle

type Battle struct {
	ID                  int                    `json:"id"`
	UUID                string                 `json:"uuid"`
	Map                 *_map.Map              `json:"-"`
	Teams               map[int]*Team          `json:"teams"`
	WaitReady           bool                   `json:"wait_ready"`
	WaitTimeOut         int                    `json:"wait_time_out"`
	SessionPlayersState map[int]*SessionPlayer `json:"session_players_state"`
	// contains filtered or unexported fields
}

func (*Battle) AddUser

func (b *Battle) AddUser(newPlayer *player.Player)

func (*Battle) CalcReady

func (b *Battle) CalcReady(players []*player.Player)

func (*Battle) GetChanPlayers

func (b *Battle) GetChanPlayers() <-chan *player.Player

func (*Battle) GetPlayerByID

func (b *Battle) GetPlayerByID(userID int) *player.Player

func (*Battle) GetPlayerTeams

func (b *Battle) GetPlayerTeams() map[int]*Team

func (*Battle) GetPlayers

func (b *Battle) GetPlayers(basket []*player.Player) []*player.Player

func (*Battle) RemovePlayer

func (b *Battle) RemovePlayer(removePlayer *player.Player)

func (*Battle) UnsafeRangePlayers

func (b *Battle) UnsafeRangePlayers() ([]*player.Player, *sync.RWMutex)

type SessionPlayer

type SessionPlayer struct {
	UUID     string `json:"uuid"`
	PlayerID int    `json:"player_id"`
	Login    string `json:"login"`
	Live     bool   `json:"live"`
}

type Team

type Team struct {
	ID         int   `json:"id"`
	Hide       bool  `json:"hide"`
	PlayersIDs []int `json:"players_ids"`
	AI         bool  `json:"ai"`
	// contains filtered or unexported fields
}

func (*Team) AddDynamicObject

func (t *Team) AddDynamicObject(object *dynamic_map_object.Object, mapID int, view, radar bool, mapTime int64)

func (*Team) AddUnion

func (t *Team) AddUnion(id int)

func (*Team) AddVisibleObject

func (t *Team) AddVisibleObject(newObj *visible_objects.VisibleObject)

func (*Team) CheckUnion

func (t *Team) CheckUnion(id int) bool

func (*Team) GetID

func (t *Team) GetID() int

func (*Team) GetMapDynamicObjectByID

func (t *Team) GetMapDynamicObjectByID(id int) *visible_objects.VisibleObject

func (*Team) GetMapDynamicObjects

func (t *Team) GetMapDynamicObjects(mapID int) <-chan *visible_objects.VisibleObject

func (*Team) GetTeamID

func (t *Team) GetTeamID() int

func (*Team) GetType

func (t *Team) GetType() string

func (*Team) GetUpdateViewObjects

func (t *Team) GetUpdateViewObjects() bool

todo мега костыль что бы не обновлять обьекты каждые 32 мс а как укажешь

func (*Team) GetVisibleObjectByTypeAndID

func (t *Team) GetVisibleObjectByTypeAndID(typeObj string, id int) *visible_objects.VisibleObject

func (*Team) GetVisibleObjectStore

func (t *Team) GetVisibleObjectStore() *visible_objects.VisibleObjectsStore

func (*Team) GetVisibleObjects

func (t *Team) GetVisibleObjects() <-chan *visible_objects.VisibleObject

func (*Team) InitMemmoryObjects

func (t *Team) InitMemmoryObjects()

func (*Team) InitVisibleObjects

func (t *Team) InitVisibleObjects()

func (*Team) RemoveDynamicObject

func (t *Team) RemoveDynamicObject(id int)

func (*Team) RemoveVisibleObject

func (t *Team) RemoveVisibleObject(removeObj *visible_objects.VisibleObject)

func (*Team) UnsafeRangeMapDynamicObjects

func (t *Team) UnsafeRangeMapDynamicObjects() ([]*visible_objects.VisibleObject, *sync.RWMutex)

func (*Team) UnsafeRangeVisibleObjects

func (t *Team) UnsafeRangeVisibleObjects() ([]*visible_objects.VisibleObject, *sync.RWMutex)

Jump to

Keyboard shortcuts

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