blocks

package
v0.0.0-...-917e924 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arr

type Arr struct {
	// contains filtered or unexported fields
}

Arr ...

func ArrFromTemplate

func ArrFromTemplate(template []int, rows int) *Arr

ArrFromTemplate ..

func NewArr

func NewArr(rows int, cols int) *Arr

NewArr ...

func (*Arr) CanPlace

func (a *Arr) CanPlace(piece *Arr, r int, c int) bool

CanPlace ...

func (*Arr) ClearRow

func (a *Arr) ClearRow(r int)

ClearRow ...

func (Arr) Clone

func (a Arr) Clone() *Arr

Clone ...

func (*Arr) IsRowFull

func (a *Arr) IsRowFull(r int) bool

IsRowFull ...

func (*Arr) Place

func (a *Arr) Place(piece *Arr, r int, c int)

Place ...

func (*Arr) Remove

func (a *Arr) Remove(piece *Arr, r int, c int)

Remove ...

func (*Arr) RemoveFullRows

func (a *Arr) RemoveFullRows() int

RemoveFullRows ...

func (*Arr) RemoveRow

func (a *Arr) RemoveRow(row int)

RemoveRow ...

func (*Arr) RotateClockwise

func (a *Arr) RotateClockwise() *Arr

RotateClockwise ...

func (*Arr) RotateCounterClockwise

func (a *Arr) RotateCounterClockwise() *Arr

RotateCounterClockwise ...

func (*Arr) ShiftRow

func (a *Arr) ShiftRow(r int)

ShiftRow ...

type Meta

type Meta struct {
	Rows     int `json:"rows"`
	Cols     int `json:"cols"`
	Overflow int `json:"overflow"`
}

Meta ...

func Metadata

func Metadata() *Meta

Metadata ...

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model ...

func NewModel

func NewModel() *Model

NewModel ...

func (*Model) Run

func (m *Model) Run()

Run ...

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session ...

func NewSession

func NewSession(conn *websocket.Conn) *Session

NewSession ...

func (*Session) Run

func (s *Session) Run()

Run ...

type State

type State struct {
	Tiles    []int `json:"tiles"`
	Score    int   `json:"score"`
	Level    int   `json:"level"`
	GameOver bool  `json:"gameOver"`
}

State ...

Jump to

Keyboard shortcuts

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