player

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notify

type Notify struct {
	Name    string             `json:"name"`
	UUID    string             `json:"uuid"`
	Event   string             `json:"event"`
	Send    bool               `json:"send"`
	Data    interface{}        `json:"data"`
	Destroy bool               `json:"destroy"`
	Count   int                `json:"count"`
	Price   int                `json:"price"`
	Item    *inventory.Slot    `json:"item"`
	Base    *base.Base         `json:"base"`
	Map     *_map.ShortInfoMap `json:"map"`
}

type Player

type Player struct {
	ID    int    `json:"id"`
	Login string `json:"login"`

	ScientificPoints int `json:"scientific_points"`
	AttackPoints     int `json:"attack_points"`
	ProductionPoints int `json:"production_points"`

	Training int `json:"training"`

	LobbyReady bool

	InBaseID           int `json:"-"` // ид базы в которой сидит игрок
	LastBaseID         int `json:"-"` // последняя база которую посетил игрок
	LastBaseEfficiency int `json:"-"` // эффективность базы которая была зафисирована в последний раз, сделала что бы не спамить статусом базы

	/* мета для ботов */
	Bot      bool `json:"bot"`      // переменная говорит что это не игрок))
	Behavior int  `json:"behavior"` // тип поведения бота

	UUID         string                   `json:"uuid"`
	GlobalPath   []*coordinate.Coordinate `json:"global_path"`   // маршрут через сектора, тут лежат координаты переходов, входов на базы
	CurrentPoint int                      `json:"current_point"` // номер ячейку куда надо пиздовать
	Leave        bool                     `json:"leave"`
	ToLeave      bool                     `json:"to_leave"`
	LocalPact    int                      `json:"local_pact"`
	Fraction     string                   `json:"fraction"`

	Biography string `json:"biography"`
	Title     string `json:"title"`

	// [name]Skill
	CurrentSkills map[string]*skill.Skill     `json:"current_skills"`
	Missions      map[string]*mission.Mission `json:"missions"`
	// uuid мисси которую отслеживает игрок, от этого зависит что будет отображатся на мини карте и в блоке заданий на фронте
	SelectMission string `json:"select_mission"`

	NotifyQueue map[string]*Notify `json:"notify_queue"`

	UserInterface map[string]map[string]*Window `json:"user_interface"` // resolution, window_id, state
	StoryEpisode  int                           `json:"story_episode"`

	DebugMoveMessage []interface{}

	// запомненные динамические обьекты на карте [map_id][x][y]
	MemoryDynamicObjects map[int]map[int]map[int]*dynamic_map_object.Object `json:"memory_dynamic_objects"`
	// contains filtered or unexported fields
}

func (*Player) AddDynamicObject

func (client *Player) AddDynamicObject(object *dynamic_map_object.Object, mapID int)

func (*Player) GetAvatar

func (client *Player) GetAvatar() string

func (*Player) GetCredits

func (client *Player) GetCredits() int

func (*Player) GetEmail

func (client *Player) GetEmail() string

func (*Player) GetFakeWS

func (client *Player) GetFakeWS() *websocket.Conn

func (*Player) GetID

func (client *Player) GetID() (id int)

func (*Player) GetLogin

func (client *Player) GetLogin() (login string)

func (*Player) GetMapDynamicObject

func (client *Player) GetMapDynamicObject(mapID, x, y int) *dynamic_map_object.Object

func (*Player) GetMapDynamicObjectByID

func (client *Player) GetMapDynamicObjectByID(mapID, id int) *dynamic_map_object.Object

func (*Player) GetMapDynamicObjects

func (client *Player) GetMapDynamicObjects(mapID int) map[int]map[int]*dynamic_map_object.Object

func (*Player) GetOpenDialog

func (client *Player) GetOpenDialog() *dialog.Dialog

func (*Player) GetShortUserInfo

func (client *Player) GetShortUserInfo(squad bool) *ShortUserInfo

func (*Player) GetSquad

func (client *Player) GetSquad() *squad.Squad

func (*Player) GetSquads

func (client *Player) GetSquads() []*squad.Squad

func (*Player) GetSquadsByBaseID

func (client *Player) GetSquadsByBaseID(BaseID int) []*squad.Squad

func (*Player) GetSquadsByID

func (client *Player) GetSquadsByID(ID int) *squad.Squad

func (*Player) ReloadNotify

func (client *Player) ReloadNotify()

func (*Player) RemoveDynamicObject

func (client *Player) RemoveDynamicObject(object *dynamic_map_object.Object, mapID int)

func (*Player) RemoveSquadsByID

func (client *Player) RemoveSquadsByID(ID int)

func (*Player) SetAvatar

func (client *Player) SetAvatar(avatar string)

func (*Player) SetCredits

func (client *Player) SetCredits(credits int)

func (*Player) SetEmail

func (client *Player) SetEmail(email string)

func (*Player) SetFakeWS

func (client *Player) SetFakeWS(ws *websocket.Conn)

func (*Player) SetID

func (client *Player) SetID(id int)

func (*Player) SetLogin

func (client *Player) SetLogin(login string)

func (*Player) SetOpenDialog

func (client *Player) SetOpenDialog(newDialog *dialog.Dialog)

func (*Player) SetSquad

func (client *Player) SetSquad(squad *squad.Squad)

func (*Player) SetSquads

func (client *Player) SetSquads(squads []*squad.Squad)

func (*Player) UpSkill

func (client *Player) UpSkill(id int) (*skill.Skill, bool)

type ShortUserInfo

type ShortUserInfo struct {
	// структура которая описываем минимальный набор данных для отображение и взаимодействия,
	// что бы другие игроки не палили трюмы, фиты и дронов без спец оборудования
	UserID   string `json:"user_id"`
	SquadID  string `json:"squad_id"`
	UserName string `json:"user_name"`

	Biography string `json:"biography"`
	Title     string `json:"title"`
	Fraction  string `json:"fraction"`

	MotherShip *unit.ShortUnitInfo `json:"mother_ship"`
}

type Window

type Window struct {
	Left   int  `json:"left"`
	Top    int  `json:"top"`
	Height int  `json:"height"`
	Width  int  `json:"width"`
	Open   bool `json:"open"`
}

текущие положение интерфейса пользователя

Jump to

Keyboard shortcuts

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