1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-12 18:50:42 +00:00

all: use goimports to format code and fix two minor typos in comments (#326)

Typos located using misspell: https://github.com/client9/misspell

Formatting done using goimports: https://godoc.org/golang.org/x/tools/cmd/goimports
This commit is contained in:
Robin Eklind 2020-04-11 20:56:47 +02:00 committed by GitHub
parent 019bb920c9
commit ff4f0b0bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 83 additions and 76 deletions

View File

@ -263,7 +263,7 @@ func adjustTree(newNode *linkedNode) {
continue
}
// The following code basicly swaps insertpoint with current
// The following code basically swaps insertpoint with current
// remove insert point
if insertpoint.Prev != nil {

View File

@ -1,6 +1,5 @@
package d2datadict
var objectLookups = []ObjectLookupRecord{
{Act: 1, Type: ObjectTypeCharacter, Id: 0, Description: "gheed-ACT 1 TABLE", ObjectsTxtId: -1, MonstatsTxtId: -1, Direction: -1, Base: "/Data/Global/Monsters", Token: "GH", Mode: "NU", Class: "HTH", TR: "LIT", Index: -1},
{Act: 1, Type: ObjectTypeCharacter, Id: 1, Description: "cain1-ACT 1 TABLE", ObjectsTxtId: -1, MonstatsTxtId: -1, Direction: -1, Base: "/Data/Global/Monsters", Token: "DC", Mode: "NU", Class: "HTH", TR: "LIT", Index: -1},

View File

@ -1,8 +1,9 @@
package d2datadict
import (
testify "github.com/stretchr/testify/assert"
"testing"
testify "github.com/stretchr/testify/assert"
)
// Verify the lookup returns the right object after indexing.

View File

@ -11,7 +11,7 @@ type SubTileFlags struct {
Unknown3 bool
}
func (s* SubTileFlags) DebugString() string {
func (s *SubTileFlags) DebugString() string {
result := ""
if s.BlockWalk {
result += "BlockWalk "
@ -42,13 +42,13 @@ func (s* SubTileFlags) DebugString() string {
func NewSubTileFlags(data byte) SubTileFlags {
return SubTileFlags{
BlockWalk: data & 1 == 1,
BlockLOS: data & 2 == 2,
BlockJump: data & 4 == 4,
BlockPlayerWalk: data & 8 == 8,
Unknown1: data & 16 == 16,
BlockLight: data & 32 == 32,
Unknown2: data & 64 == 64,
Unknown3: data & 128 == 128,
BlockWalk: data&1 == 1,
BlockLOS: data&2 == 2,
BlockJump: data&4 == 4,
BlockPlayerWalk: data&8 == 8,
Unknown1: data&16 == 16,
BlockLight: data&32 == 32,
Unknown2: data&64 == 64,
Unknown3: data&128 == 128,
}
}

View File

@ -1,8 +1,9 @@
package d2dt1
import (
testify "github.com/stretchr/testify/assert"
"testing"
testify "github.com/stretchr/testify/assert"
)
func TestNewSubTile(t *testing.T) {

View File

@ -105,7 +105,7 @@ func SplitIntoLinesWithMaxWidth(fullSentence string, maxChars int) []string {
totalLength := 0
words := strings.Split(fullSentence, " ")
if len(words[0]) > maxChars {
// mostly happend within CJK characters (no whitespace)
// mostly happened within CJK characters (no whitespace)
return splitCjkIntoChunks(fullSentence, maxChars)
}
for _, word := range words {

View File

@ -7,9 +7,9 @@ import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dat"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2mpq"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2pl2"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2config"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2term"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2pl2"
)
var singleton *assetManager

View File

@ -22,7 +22,7 @@ func (pm *paletteTransformManager) loadPaletteTransform(path string) (*d2pl2.PL2
return pl2.(*d2pl2.PL2File), nil
}
data, err := LoadFile(path);
data, err := LoadFile(path)
if err != nil {
return nil, err
}

View File

@ -1,10 +1,11 @@
package d2map
import (
"github.com/beefsack/go-astar"
"math"
"strings"
"github.com/beefsack/go-astar"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2audio"

View File

@ -2,10 +2,11 @@ package d2map
import (
"fmt"
"math"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2data/d2datadict"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2resource"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2asset"
"math"
)
type Missile struct {

View File

@ -1,11 +1,12 @@
package d2map
import (
"math/rand"
"github.com/OpenDiablo2/OpenDiablo2/d2common"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2data/d2datadict"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2resource"
"math/rand"
)
type NPC struct {

View File

@ -1,9 +1,10 @@
package d2map
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common"
"math"
"sort"
"github.com/OpenDiablo2/OpenDiablo2/d2common"
)
type MapEntitiesSearcher interface {

View File

@ -1,10 +1,11 @@
package d2map
import (
"testing"
"github.com/OpenDiablo2/OpenDiablo2/d2common"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2render"
"github.com/stretchr/testify/assert"
"testing"
)
type mockEntity struct {

View File

@ -1,6 +1,6 @@
package d2render
// Filter represents the type of texture filter to be used when an image is maginified or minified.
// Filter represents the type of texture filter to be used when an image is magnified or minified.
type Filter int
const (

View File

@ -42,7 +42,7 @@ const (
// ButtonLayout defines the type of buttons
type ButtonLayout struct {
XSegments int //1
XSegments int // 1
YSegments int // 1
ResourceName string // Font Name
PaletteName string // PaletteType

View File

@ -1,8 +1,9 @@
package d2player
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
type TestItem struct {