squad

package
v0.0.0-...-54eea7a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 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 Squad

type Squad struct {
	ID             int                        `json:"id"`
	Name           string                     `json:"name"`
	Active         bool                       `json:"active"`
	MatherShip     *unit.Unit                 `json:"mather_ship"`
	InGame         bool                       `json:"in_game"`
	BaseID         int                        `json:"base_id"` /* если отряд не у игрока то он храниться на этой базе */
	SoftTransition bool                       `json:"soft_transition"`
	VisibleObjects map[string]*VisibleObjects `json:"-"` // key id_object+type_object

	/* необходимые флаги что бы обеспечить правильную перегрзку методов воркеров*/
	RecoveryPowerWork bool `json:"-"`
	RecoveryPowerExit bool `json:"-"`

	GunWorkerWork bool `json:"-"`
	GunWorkerExit bool `json:"-"`

	RadarWorkerWork bool `json:"-"`
	RadarWorkerExit bool `json:"-"`
	// contains filtered or unexported fields
}

func (*Squad) AddVisibleObject

func (s *Squad) AddVisibleObject(newObj *VisibleObjects)

func (*Squad) CheckViewCoordinate

func (s *Squad) CheckViewCoordinate(x, y int) (bool, bool)

func (*Squad) GetFormationCoordinate

func (s *Squad) GetFormationCoordinate(x, y int) (int, int)

func (*Squad) GetShortUnits

func (s *Squad) GetShortUnits() map[int]*unit.ShortUnitInfo

func (*Squad) GetUnitByID

func (s *Squad) GetUnitByID(id int) *unit.Unit

func (*Squad) GetVisibleObjectByID

func (s *Squad) GetVisibleObjectByID(id string) *VisibleObjects

func (*Squad) RadarLock

func (s *Squad) RadarLock()

func (*Squad) RadarUnlock

func (s *Squad) RadarUnlock()

func (*Squad) RemoveVisibleObject

func (s *Squad) RemoveVisibleObject(removeObj *VisibleObjects)

func (*Squad) UpdateLock

func (s *Squad) UpdateLock()

func (*Squad) UpdateUnlock

func (s *Squad) UpdateUnlock()

type VisibleObjects

type VisibleObjects struct {
	IDObject   int    `json:"id_object"`
	TypeObject string `json:"type_object"`
	UUID       string `json:"uuid"`
	View       bool   `json:"view"`  // в прямой видимости
	Radar      bool   `json:"radar"` // видим только радаром
	Type       string `json:"type"`  // fly(летающий), ground(наземный), structure(структура), resource(ресурс)
	Update     bool   `json:"update"`
}

Jump to

Keyboard shortcuts

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