place

package module
v0.0.0-...-0967068 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 14 Imported by: 0

README

/r/place

GoDoc

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultColorPalette = color.Palette{
	color.RGBA{0xFF, 0xFF, 0xFF, 0xFF},
	color.RGBA{0xE4, 0xE4, 0xE4, 0xFF},
	color.RGBA{0x88, 0x88, 0x88, 0xFF},
	color.RGBA{0x22, 0x22, 0x22, 0xFF},
	color.RGBA{0xFF, 0xA7, 0xD1, 0xFF},
	color.RGBA{0xE5, 0x00, 0x00, 0xFF},
	color.RGBA{0xE5, 0x95, 0x00, 0xFF},
	color.RGBA{0xA0, 0x6A, 0x42, 0xFF},
	color.RGBA{0xE5, 0xD9, 0x00, 0xFF},
	color.RGBA{0x94, 0xE0, 0x44, 0xFF},
	color.RGBA{0x02, 0xBE, 0x01, 0xFF},
	color.RGBA{0x00, 0xD3, 0xDD, 0xFF},
	color.RGBA{0x00, 0x83, 0xC7, 0xFF},
	color.RGBA{0x00, 0x00, 0xEA, 0xFF},
	color.RGBA{0xCF, 0x6E, 0xE4, 0xFF},
	color.RGBA{0x82, 0x00, 0x80, 0xFF},
}

Functions

func GetBitmap

func GetBitmap() (image.Image, error)

func ReadChanges

func ReadChanges(c *websocket.Conn) <-chan TileUpdate

Types

type Client

type Client struct {
	*http.Client
}

func Login

func Login(username, password string) (*Client, error)

func (Client) Draw

func (c Client) Draw(x, y int, color color.Color) (time.Duration, error)

func (Client) WaitTime

func (c Client) WaitTime() (time.Duration, error)

type Event

type Event struct {
	Type    string          `json:"type"`
	Payload json.RawMessage `json:"payload"`
}

type Info

type Info struct {
	Username  string  `json:"user_name"`
	Timestamp float64 `json:"timestamp"`

	Tile
}

func GetPixel

func GetPixel(x, y int) (*Info, error)

type Tile

type Tile struct {
	Y     int          `json:"y"`
	X     int          `json:"x"`
	Color paletteIndex `json:"color"`
}

type TileUpdate

type TileUpdate struct {
	Tile
	Author string `json:"author"`
}

type Time

type Time struct {
	WaitSeconds float64 `json:"wait_seconds"`
}

func (Time) Duration

func (t Time) Duration() time.Duration

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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