Versions in this module Expand all Collapse all v0 v0.1.4 Jan 3, 2020 Changes in this version type Matrix + func (m *Matrix) ClearOverlayL() + func (m *Matrix) DrawActivePieceL() + func (m *Matrix) DrawGhostPieceL() + func (m *Matrix) ValidPoint(x int, y int) bool type Mino + func (m Mino) NewMinos() []Mino + func (m Mino) NewPoints() []Point v0.1.3 Nov 19, 2019 v0.1.2 Oct 30, 2019 Changes in this version type Mino + func NewMino(points string) Mino v0.1.1 Oct 28, 2019 Changes in this version + var Colors = [][]byte type Matrix + func (m *Matrix) SpawnLocation(p *Piece) Point type PieceType + const PieceUnknown v0.1.0 Oct 19, 2019 Changes in this version + const ComboBaseTime + const Domino + const GarbageDelay + const Monomino + const PentominoB + const PentominoE + const PentominoF + const PentominoG + const PentominoI + const PentominoJ + const PentominoL + const PentominoN + const PentominoP + const PentominoR + const PentominoS + const PentominoT + const PentominoU + const PentominoV + const PentominoW + const PentominoX + const PentominoY + const PentominoZ + const Rotation0 + const Rotation2 + const RotationL + const RotationR + const RotationStates + const TetrominoI + const TetrominoJ + const TetrominoL + const TetrominoO + const TetrominoS + const TetrominoT + const TetrominoZ + const TrominoI + const TrominoL + var AllOffsets = []Point + var AllRotationPivotsCCW = map[PieceType][]Point + var AllRotationPivotsCW = map[PieceType][]Point + func I(x int, y int, w int) int + type Bag struct + Minos []Mino + Original []Mino + func NewBag(seed int64, minos []Mino, width int) (*Bag, error) + func (b *Bag) GarbageHole() int + func (b *Bag) Next() Mino + func (b *Bag) Take() Mino + type Block int + const BlockGarbage + const BlockGhostBlue + const BlockGhostCyan + const BlockGhostGreen + const BlockGhostMagenta + const BlockGhostOrange + const BlockGhostRed + const BlockGhostYellow + const BlockNone + const BlockSolidBlue + const BlockSolidCyan + const BlockSolidGreen + const BlockSolidMagenta + const BlockSolidOrange + const BlockSolidRed + const BlockSolidYellow + func (b Block) Rune() rune + func (b Block) String() string + type LockedMatrix *Matrix + type LockedPiece *Piece + type Matrix struct + B int + Bag *Bag + Combo int + ComboEnd time.Time + ComboStart time.Time + Event chan<- interface{} + GameOver bool + GarbageReceived int + GarbageSent int + H int + LinesCleared int + M map[int]Block + Move chan int + O map[int]Block + P *Piece + PendingGarbage int + PendingGarbageTime time.Time + PlayerName string + Speed int + Type MatrixType + W int + func NewMatrix(w int, h int, b int, players int, event chan<- interface{}, ...) *Matrix + func NewTestMatrix() (*Matrix, error) + func (m *Matrix) Add(mn *Piece, b Block, loc Point, overlay bool) error + func (m *Matrix) AddPendingGarbage(lines int) + func (m *Matrix) AddTestBlocks() + func (m *Matrix) AttachBag(bag *Bag) bool + func (m *Matrix) Block(x int, y int) Block + func (m *Matrix) CalculateBonusGarbage() int + func (m *Matrix) CanAdd(mn *Piece) bool + func (m *Matrix) CanAddAt(mn *Piece, loc Point) bool + func (m *Matrix) Clear() + func (m *Matrix) ClearFilled() int + func (m *Matrix) ClearOverlay() + func (m *Matrix) Draw() + func (m *Matrix) DrawPieces() + func (m *Matrix) DrawPiecesL() + func (m *Matrix) Empty(loc Point) bool + func (m *Matrix) HandleReceiveGarbage() + func (m *Matrix) HardDropPiece() + func (m *Matrix) LineFilled(y int) bool + func (m *Matrix) LowerPiece() + func (m *Matrix) MarshalJSON() ([]byte, error) + func (m *Matrix) MovePiece(x int, y int) bool + func (m *Matrix) Moved() + func (m *Matrix) NewM() map[int]Block + func (m *Matrix) NewO() map[int]Block + func (m *Matrix) ReceiveGarbage() + func (m *Matrix) Render() string + func (m *Matrix) Replace(newmtx *Matrix) + func (m *Matrix) Reset() + func (m *Matrix) RotatePiece(rotations int, direction int) bool + func (m *Matrix) SetBlock(x int, y int, block Block, overlay bool) bool + func (m *Matrix) SetGameOver() + func (m *Matrix) TakePiece() bool + type MatrixType int + const MatrixCustom + const MatrixPreview + const MatrixStandard + type Mino []Point + func Generate(rank int) ([]Mino, error) + func (m Mino) Canonical() Mino + func (m Mino) Equal(other Mino) bool + func (m Mino) Flatten() Mino + func (m Mino) HasPoint(p Point) bool + func (m Mino) Height() int + func (m Mino) Len() int + func (m Mino) Less(i, j int) bool + func (m Mino) Origin() Mino + func (m Mino) Render() string + func (m Mino) Size() (int, int) + func (m Mino) String() string + func (m Mino) Swap(i, j int) + func (m Mino) Variations() []Mino + func (m Mino) Width() int + type Minos []Mino + func (ms Minos) Has(m Mino) bool + type Piece struct + Ghost Block + Rotation int + Solid Block + func NewPiece(m Mino, loc Point) *Piece + func (p *Piece) ApplyReset() + func (p *Piece) ApplyRotation(rotations int, direction int) + func (p *Piece) Rotate(rotations int, direction int) Mino + func (p *Piece) SetLocation(x int, y int) + func (p *Piece) String() string + type PieceType int + const PieceI + const PieceJ + const PieceJLSTZ + const PieceL + const PieceO + const PieceS + const PieceT + const PieceZ + type Point struct + X int + Y int + func (p Point) Neighborhood() Mino + func (p Point) Reflect() Point + func (p Point) Rotate180() Point + func (p Point) Rotate270() Point + func (p Point) Rotate90() Point + func (p Point) String() string + type RotationOffsets []Point