Documentation
¶
Index ¶
- Variables
- func GetCurrentLocation() (currentLocation string, recommendedServer string, err error)
- type Cell
- type CellDestroyed
- type CellUpdate
- type Connection
- type Game
- type Info
- type LeaderboardItem
- type Message
- type MessageCanvasSize
- type MessageHello
- type MessageLeaderboard
- type MessageMyID
- type MessageTeamLeaderboard
- type MessageUpdate
- type Point
- type Region
- type TickFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownMessage = errors.New("agario: received unknown message type")
Functions ¶
func GetCurrentLocation ¶
Types ¶
type Cell ¶
type Cell struct { ID uint32 Name string Position mgl32.Vec2 // Current position Heading mgl32.Vec2 // Heading as normalized vector Size int32 Color color.Color IsVirus bool }
func (*Cell) SplitDistance ¶
type CellDestroyed ¶
type CellUpdate ¶
type Connection ¶
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Read ¶
func (c *Connection) Read() (msg Message, err error)
func (*Connection) SendNickname ¶
func (c *Connection) SendNickname(nickname string) error
func (*Connection) SendSplit ¶
func (c *Connection) SendSplit() error
func (*Connection) SendTarget ¶
func (c *Connection) SendTarget(x, y float64) error
type Game ¶
type Game struct { *sync.Mutex Leaderboard []*LeaderboardItem Board *MessageCanvasSize MyIDs map[uint32]struct{} Cells map[uint32]*Cell // contains filtered or unexported fields }
func NewGame ¶
func NewGame(c *Connection) *Game
func (*Game) SendNickname ¶
func (*Game) SetTargetPos ¶
type LeaderboardItem ¶
type MessageCanvasSize ¶
type MessageHello ¶
type MessageHello struct{}
type MessageLeaderboard ¶
type MessageLeaderboard struct {
Items []*LeaderboardItem
}
type MessageMyID ¶
type MessageMyID struct {
MyCell uint32
}
type MessageTeamLeaderboard ¶
type MessageUpdate ¶
type MessageUpdate struct { Destroyed []*CellDestroyed Updated []*CellUpdate Clean []uint32 }
Click to show internal directories.
Click to hide internal directories.