MCPcopy Index your code

hub / github.com/Broderick-Westrope/tetrigo / functions

Functions276 in github.com/Broderick-Westrope/tetrigo

↓ 35 callersMethodRun
(globals *GlobalVars)
cmd/tetrigo/subcommands.go:16
↓ 26 callersMethodReturn
(_a0 int)
internal/tui/components/mock_Stopwatch.go:105
↓ 14 callersMethodView
()
internal/tui/components/timer.go:13
↓ 11 callersFunctionFatalErrorCmd
FatalErrorCmd returns a command for creating a new FatalErrorMsg with the given error.
internal/tui/messages.go:9
↓ 10 callersMethodEXPECT
()
internal/tui/components/mock_Stopwatch.go:21
↓ 10 callersMethodRun
(run func())
internal/tui/components/mock_Stopwatch.go:98
↓ 9 callersMethodInit
()
internal/tui/components/timer.go:11
↓ 8 callersMethodDeepCopy
()
pkg/tetris/matrix.go:49
↓ 8 callersMethodUpdate
(tea.Msg)
internal/tui/components/timer.go:12
↓ 6 callersMethodCalculateFallSpeeds
(level int)
pkg/tetris/fall.go:20
↓ 6 callersFunctionDefaultKeys
()
internal/config/keys.go:16
↓ 6 callersFunctionDefaultTheme
()
internal/config/theme.go:24
↓ 6 callersFunctionNewSingleModel
( in *tui.SingleInput, cfg *config.Config, opts ...func(*SingleModel), )
internal/tui/views/single.go:70
↓ 6 callersMethodNext
Next returns the next Tetrimino, removing it from the queue and refilling if necessary. This applies the skyline value (provided in NewNextQueue) to t
pkg/tetris/next_queue.go:45
↓ 5 callersMethodElapsed
()
internal/tui/components/stopwatch.go:14
↓ 5 callersFunctionNewLeaderboardModel
(in *tui.LeaderboardInput, db *sql.DB)
internal/tui/views/leaderboard.go:31
↓ 5 callersMethodToggle
()
internal/tui/components/timer.go:18
↓ 5 callersFunctionWithRandSource
(r *rand.Rand)
internal/tui/views/single.go:146
↓ 4 callersMethodAddTetrimino
AddTetrimino adds the given Tetrimino to the Matrix. It returns an error if the Tetrimino is out of bounds or if the Tetrimino overlaps with an occupi
pkg/tetris/matrix.go:86
↓ 4 callersMethodGetSkyline
GetSkyline returns the skyline; the highest row that the player can see.
pkg/tetris/matrix.go:40
↓ 4 callersMethodIsValid
()
pkg/tetris/action.go:108
↓ 4 callersMethodMoveDown
MoveDown moves the tetrimino down one row. This does not modify the matrix. If the tetrimino cannot move down, it will not be modified and false will
pkg/tetris/tetrimino.go:227
↓ 4 callersFunctionNewNextQueue
NewNextQueue creates a new NextQueue of Tetriminos.
pkg/tetris/next_queue.go:16
↓ 4 callersFunctionSetupInMemoryDB
(t *testing.T)
internal/tui/testutils/testutils.go:34
↓ 4 callersMethodString
()
internal/tui/mode.go:45
↓ 4 callersFunctionSwitchModeCmd
(target Mode, in SwitchModeInput)
internal/tui/mode.go:18
↓ 4 callersMethodcanPlaceInCell
(row, col int)
pkg/tetris/matrix.go:161
↓ 4 callersFunctionisCellEmpty
(cell byte)
pkg/tetris/matrix.go:157
↓ 4 callersMethodsetupNewTetInPlay
setupNewTetInPlay will do the following setup for the new Tetrimino in play: - If possible, move down one row into the visible Matrix. - Check for Loc
pkg/tetris/modes/single/single.go:255
↓ 4 callersMethodtriggerGameOver
()
internal/tui/views/single.go:501
↓ 4 callersMethodupdateGhost
()
pkg/tetris/modes/single/single.go:280
↓ 3 callersMethodAddSoftDrop
AddSoftDrop adds points for a soft drop.
pkg/tetris/scoring.go:74
↓ 3 callersMethodDeepCopy
DeepCopy creates a deep copy of the Tetrimino. This is useful when you need to modify a Tetrimino without affecting the original.
pkg/tetris/tetrimino.go:434
↓ 3 callersFunctionDefaultMatrix
DefaultMatrix creates a new Matrix with a height of 40 and a width of 10.
pkg/tetris/matrix.go:12
↓ 3 callersMethodID
()
internal/tui/components/timer.go:14
↓ 3 callersMethodIsGameOver
()
pkg/tetris/modes/single/getters.go:9
↓ 3 callersMethodLevel
Level returns the current level.
pkg/tetris/scoring.go:59
↓ 3 callersFunctionNewFall
(level int)
pkg/tetris/fall.go:14
↓ 3 callersFunctionNewLeaderboardRepository
(db *sql.DB)
internal/data/leaderboard.go:23
↓ 3 callersFunctionNewMatrix
NewMatrix creates a new Matrix with the given height and width. It returns an error if the height is less than 20 to allow for a buffer zone of 20 lin
pkg/tetris/matrix.go:22
↓ 3 callersFunctionNewMenuInput
()
internal/tui/mode.go:69
↓ 3 callersFunctionNewMenuModel
(_ *tui.MenuInput)
internal/tui/views/menu.go:40
↓ 3 callersFunctionNewMockStopwatch
NewMockStopwatch creates a new instance of MockStopwatch. It also registers a testing interface on the mock and a cleanup function to assert the mocks
internal/tui/components/mock_Stopwatch.go:443
↓ 3 callersFunctionNewStopwatchWithInterval
(interval time.Duration)
internal/tui/components/stopwatch.go:26
↓ 3 callersMethodRotate
Rotate rotates the Tetrimino clockwise or counter-clockwise. This does not modify the matrix. This will automatically use Super Rotation System (SRS).
pkg/tetris/tetrimino.go:291
↓ 3 callersMethodSave
Save saves a score to the leaderboard and returns the ID of the new score.
internal/data/leaderboard.go:51
↓ 3 callersMethodStop
()
internal/tui/components/timer.go:17
↓ 3 callersMethodToggleSoftDrop
()
pkg/tetris/fall.go:29
↓ 3 callersFunctionWaitForMsgOfType
(t *testing.T, tm *teatest.TestModel, msgCh chan T, timeout time.Duration)
internal/tui/testutils/testutils.go:14
↓ 3 callersMethodfill
fill adds Tetriminos to the queue until it has 7 or more. This is done by getting all valid Tetriminos, shuffling them, and adding them to the queue.
pkg/tetris/next_queue.go:59
↓ 3 callersFunctionlaunchStarter
(globals *GlobalVars, starterMode tui.Mode, switchIn tui.SwitchModeInput)
cmd/tetrigo/subcommands.go:49
↓ 3 callersFunctionpositiveMod
positiveMod calculates the positive modulus of the dividend and divisor. This is used to handle negative numbers in a way that is consistent with the
pkg/tetris/tetrimino.go:411
↓ 3 callersMethodrenderCell
(cell byte)
internal/tui/views/single.go:484
↓ 3 callersMethodtranspose
transpose transposes the Tetrimino's cells. This is used during rotation to rotate the Tetrimino.
pkg/tetris/tetrimino.go:393
↓ 2 callersMethodAddHardDrop
AddHardDrop adds points for a hard drop.
pkg/tetris/scoring.go:79
↓ 2 callersFunctionEnsureTablesExist
(db *sql.DB)
internal/data/data.go:24
↓ 2 callersMethodGetDefaultFallInterval
()
pkg/tetris/modes/single/getters.go:50
↓ 2 callersMethodGetLevel
()
pkg/tetris/modes/single/getters.go:42
↓ 2 callersMethodGetLinesCleared
()
pkg/tetris/modes/single/getters.go:46
↓ 2 callersFunctionGetTetrimino
GetTetrimino returns the Tetrmino with the given value. Valid values are: I, O, T, S, Z, J, L.
pkg/tetris/tetrimino.go:208
↓ 2 callersMethodGetTotalScore
()
pkg/tetris/modes/single/getters.go:38
↓ 2 callersMethodIsAboveSkyline
IsAboveSkyline returns true if the entire Tetrimino is above the skyline. This can be helpful when checking for Lock Out.
pkg/tetris/tetrimino.go:469
↓ 2 callersMethodIsValid
IsValid returns true if the given Tetrimino is within the bounds of the matrix and does not overlap with any occupied cells. If checkBounds is false,
pkg/tetris/tetrimino.go:487
↓ 2 callersMethodLines
Lines returns the total lines cleared.
pkg/tetris/scoring.go:69
↓ 2 callersMethodMoveLeft
MoveLeft moves the tetrimino left one column. This does not modify the matrix. If the tetrimino cannot move left false will be returned.
pkg/tetris/tetrimino.go:248
↓ 2 callersMethodMoveRight
MoveRight moves the tetrimino right one column. This does not modify the matrix. If the tetrimino cannot move right false will be returned.
pkg/tetris/tetrimino.go:269
↓ 2 callersFunctionNewLeaderboardInput
(gameMode string, opts ...func(input *LeaderboardInput))
internal/tui/mode.go:80
↓ 2 callersFunctionNewScoring
NewScoring creates a new scoring system.
pkg/tetris/scoring.go:25
↓ 2 callersFunctionNewSingleInput
(mode Mode, level int, username string)
internal/tui/mode.go:57
↓ 2 callersMethodProcessAction
ProcessAction processes an action and updates the score, lines cleared, level, etc. The returned boolean indicates if the game should end.
pkg/tetris/scoring.go:85
↓ 2 callersMethodRemoveCompletedLines
RemoveCompletedLines checks each row that the given Tetrimino occupies and removes any completed lines from the Matrix. It returns an Action to be use
pkg/tetris/matrix.go:125
↓ 2 callersMethodReset
()
internal/tui/components/stopwatch.go:17
↓ 2 callersMethodSetInterval
(time.Duration)
internal/tui/components/stopwatch.go:15
↓ 2 callersMethodString
String returns the string representation of the Action.
pkg/tetris/action.go:75
↓ 2 callersMethodTotal
Total returns the total score.
pkg/tetris/scoring.go:64
↓ 2 callersFunctiondeepCopyCells
deepCopyCells creates a deep copy of the given 2D grid of cells.
pkg/tetris/tetrimino.go:423
↓ 2 callersFunctiongetMapOfValidTetriminos
()
pkg/tetris/tetrimino.go:118
↓ 2 callersMethodinitChild
()
internal/tui/starter/model.go:140
↓ 2 callersMethodisLineComplete
(row int)
pkg/tetris/matrix.go:58
↓ 2 callersMethodisOutOfBoundsHorizontally
(col int)
pkg/tetris/matrix.go:149
↓ 2 callersMethodisOutOfBoundsVertically
(row int)
pkg/tetris/matrix.go:153
↓ 2 callersMethodlowerTetInPlay
lowerTetInPlay moves the current Tetrimino down one row if possible. If it cannot be moved down this will instead remove completed lines, calculate sc
pkg/tetris/modes/single/single.go:220
↓ 2 callersMethodmodifyCell
(minos [][]bool, pos Coordinate, newValue byte, isExpectedValue func(byte) bool)
pkg/tetris/matrix.go:90
↓ 2 callersMethodremoveLine
(row int)
pkg/tetris/matrix.go:67
↓ 2 callersMethodrenderTetrimino
(t *tetris.Tetrimino, background byte)
internal/tui/views/single.go:469
↓ 2 callersMethodrotateClockwise
rotateClockwise rotates the Tetrimino clockwise. This does not modify the matrix. If a valid rotation is found, the rotation point is returned. If no
pkg/tetris/tetrimino.go:325
↓ 2 callersMethodrotateCounterClockwise
rotateCounterClockwise rotates the Tetrimino counter-clockwise. This does not modify the matrix. If a valid rotation is found, the rotation point is r
pkg/tetris/tetrimino.go:357
↓ 2 callersMethodsetChild
(mode tui.Mode, switchIn tui.SwitchModeInput)
internal/tui/starter/model.go:99
↓ 2 callersFunctionstringToAction
(s string)
pkg/tetris/action.go:101
↓ 2 callersMethodtogglePause
()
internal/tui/views/single.go:516
↓ 1 callersMethodAll
(gameMode string)
internal/data/leaderboard.go:27
↓ 1 callersFunctionConstructGameKeyMap
(keys *config.Keys)
internal/tui/components/game_keys.go:23
↓ 1 callersFunctionCreateGameStyles
(theme *config.Theme)
internal/tui/components/game_styles.go:32
↓ 1 callersMethodEndGame
EndGame sets Game.gameOver to true.
pkg/tetris/modes/single/single.go:211
↓ 1 callersMethodEndsBackToBack
()
pkg/tetris/action.go:116
↓ 1 callersMethodGetBagTetriminos
()
pkg/tetris/modes/single/getters.go:30
↓ 1 callersFunctionGetConfig
(path string)
internal/config/config.go:34
↓ 1 callersMethodGetElements
GetElements returns the Tetriminos in the queue.
pkg/tetris/next_queue.go:39
↓ 1 callersFunctionGetEmptyTetrimino
GetEmptyTetrimino returns a tetrimino to be used for the starting (empty) hold.
pkg/tetris/tetrimino.go:217
↓ 1 callersMethodGetHeight
GetHeight returns the height of the Matrix.
pkg/tetris/matrix.go:35
next →1–100 of 276, ranked by callers