base

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID                        int                      `json:"id"`
	Name                      string                   `json:"name"`
	X                         int                      `json:"x"`
	Y                         int                      `json:"y"`
	MapID                     int                      `json:"map_id"`
	Transports                map[int]*Transport       `json:"transports"`
	Defenders                 map[int]*Transport       `json:"defenders"`
	GravityRadius             int                      `json:"gravity_radius"`
	Respawns                  []*coordinate.Coordinate `json:"respawns"`
	RespawnLock               sync.Mutex               `json:"-"`
	BoundaryAmountOfResources int                      `json:"boundary_amount_of_resources"`
	SumWorkResources          int                      `json:"sum_work_resources"`
	CurrentResources          map[int]*inventory.Slot  `json:"current_resources"` // [id_recycled_type]count
	Efficiency                int                      `json:"efficiency"`
	Fraction                  string                   `json:"fraction"`
	Capital                   bool                     `json:"capital"`
}

func (*Base) ConsumptionBaseResource

func (b *Base) ConsumptionBaseResource()

func (*Base) CreateTransports

func (b *Base) CreateTransports(count int)

func (*Base) GetFreeTransport

func (b *Base) GetFreeTransport() *Transport

func (*Base) GetRecyclePercent

func (b *Base) GetRecyclePercent(resource int) int

func (*Base) GetSumEfficiency

func (b *Base) GetSumEfficiency() int

type Transport

type Transport struct {
	ID       int     `json:"id"`
	BaseID   int     `json:"base_id"`
	X        int     `json:"x"`
	Y        int     `json:"y"`
	Rotate   int     `json:"rotate"`
	Speed    float64 `json:"speed"`
	Fraction string  `json:"fraction"`
	Job      bool    `json:"job"`      /* на задание он или нет */
	Down     bool    `json:"down"`     /* на земле он или нет */
	SquadID  bool    `json:"squad_id"` /* ид того кого он тащит */
}

Jump to

Keyboard shortcuts

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