Skip to content

Commit

Permalink
More linting
Browse files Browse the repository at this point in the history
  • Loading branch information
z-riley committed Nov 13, 2024
1 parent b7bd4a6 commit 9622000
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ linters:
- inamedparam
- ireturn
- mnd
- musttag
- nlreturn
- nonamedreturns
- paralleltest
Expand Down
4 changes: 2 additions & 2 deletions backend/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (t *Timer) Pause() *Timer {
return t
}

// Reset starts the timer from zero.
// Reset sets the timer to zero.
func (t *Timer) Reset() *Timer {
t.Time = 0
return t
Expand All @@ -52,7 +52,7 @@ func (t *Timer) Set(d time.Duration) *Timer {
return t
}

// Duration returns the current time in time.Duration format.
// Duration returns the current time.
func (t *Timer) Duration() time.Duration {
return t.Time
}
9 changes: 4 additions & 5 deletions common/arena.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,19 +748,18 @@ func (a newFromCombineRowAnimation) String() string {
return fmt.Sprint("new-from-combine at ", a.dest)
}

// generateAnimations generates animation data a row of tiles.
// generateAnimations generates animation data for a row of tiles.
func generateRowAnimations(before, after [numTiles]grid.Tile, dir grid.Direction) []rowAnimation {
var rowAnimations []rowAnimation

// Index "before" tiles by UUID : position in row
// Build a map of each tile's "before" position, indexed by their UUID
beforeUUIDs := make(map[uuid.UUID]int, numTiles)
for x := range before {
beforeUUIDs[before[x].UUID] = x
}

// Evaluate "after" tiles
for x := range after {
// Tiles with the same UUIDs have moved
// Like UUIDs indicates that a tile has moved
beforePos, ok := beforeUUIDs[after[x].UUID]
if ok && !(beforePos == x) {
rowAnimations = append(rowAnimations, moveRowAnimation{
Expand All @@ -769,7 +768,7 @@ func generateRowAnimations(before, after [numTiles]grid.Tile, dir grid.Direction
})
}

// Tiles with the Cmb set are from combinations
// Tiles with the Cmb flag set are from combinations
if after[x].Cmb {
// Newly formed tile from combination
rowAnimations = append(rowAnimations, newFromCombineRowAnimation{
Expand Down

0 comments on commit 9622000

Please sign in to comment.