1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-18 02:16:23 -05:00

d2ds1: typofix - Substitutionlayergroup -> SubstitutionLayerGroup

This commit is contained in:
M. Sz 2021-04-07 10:48:04 +02:00
parent f880c69399
commit 53de5c17ad
2 changed files with 20 additions and 20 deletions

View File

@ -15,7 +15,7 @@ const (
FloorLayerGroup LayerGroupType = iota FloorLayerGroup LayerGroupType = iota
WallLayerGroup WallLayerGroup
ShadowLayerGroup ShadowLayerGroup
Substitutionlayergroup SubstitutionLayerGroup
) )
type layerGroup []*Layer type layerGroup []*Layer
@ -51,7 +51,7 @@ func (l *ds1Layers) cull() {
l.cullNilLayers(FloorLayerGroup) l.cullNilLayers(FloorLayerGroup)
l.cullNilLayers(WallLayerGroup) l.cullNilLayers(WallLayerGroup)
l.cullNilLayers(ShadowLayerGroup) l.cullNilLayers(ShadowLayerGroup)
l.cullNilLayers(Substitutionlayergroup) l.cullNilLayers(SubstitutionLayerGroup)
} }
// removes nil layers of given layer group type // removes nil layers of given layer group type
@ -89,7 +89,7 @@ func (l *ds1Layers) SetSize(w, h int) {
l.enforceSize(FloorLayerGroup) l.enforceSize(FloorLayerGroup)
l.enforceSize(WallLayerGroup) l.enforceSize(WallLayerGroup)
l.enforceSize(ShadowLayerGroup) l.enforceSize(ShadowLayerGroup)
l.enforceSize(Substitutionlayergroup) l.enforceSize(SubstitutionLayerGroup)
} }
func (l *ds1Layers) enforceSize(t LayerGroupType) { func (l *ds1Layers) enforceSize(t LayerGroupType) {
@ -298,20 +298,20 @@ func (l *ds1Layers) DeleteShadow(idx int) {
} }
func (l *ds1Layers) GetSubstitution(idx int) *Layer { func (l *ds1Layers) GetSubstitution(idx int) *Layer {
return l.get(Substitutionlayergroup, idx) return l.get(SubstitutionLayerGroup, idx)
} }
func (l *ds1Layers) PushSubstitution(sub *Layer) *ds1Layers { func (l *ds1Layers) PushSubstitution(sub *Layer) *ds1Layers {
l.push(Substitutionlayergroup, sub) l.push(SubstitutionLayerGroup, sub)
return l return l
} }
func (l *ds1Layers) PopSubstitution() *Layer { func (l *ds1Layers) PopSubstitution() *Layer {
return l.pop(Substitutionlayergroup) return l.pop(SubstitutionLayerGroup)
} }
func (l *ds1Layers) InsertSubstitution(idx int, newSubstitution *Layer) { func (l *ds1Layers) InsertSubstitution(idx int, newSubstitution *Layer) {
l.insert(Substitutionlayergroup, idx, newSubstitution) l.insert(SubstitutionLayerGroup, idx, newSubstitution)
} }
func (l *ds1Layers) DeleteSubstitution(idx int) { func (l *ds1Layers) DeleteSubstitution(idx int) {
@ -326,7 +326,7 @@ func (l *ds1Layers) getLayersGroup(t LayerGroupType) (group *layerGroup) {
group = &l.Walls group = &l.Walls
case ShadowLayerGroup: case ShadowLayerGroup:
group = &l.Shadows group = &l.Shadows
case Substitutionlayergroup: case SubstitutionLayerGroup:
group = &l.Substitutions group = &l.Substitutions
default: default:
return nil return nil
@ -343,7 +343,7 @@ func getMaxGroupLen(t LayerGroupType) (max int) {
max = maxWallLayers max = maxWallLayers
case ShadowLayerGroup: case ShadowLayerGroup:
max = maxShadowLayers max = maxShadowLayers
case Substitutionlayergroup: case SubstitutionLayerGroup:
max = maxSubstitutionLayers max = maxSubstitutionLayers
default: default:
return 0 return 0

View File

@ -15,7 +15,7 @@ func Test_ds1Layers_Delete(t *testing.T) {
ds1LayersDelete(t, ShadowLayerGroup) ds1LayersDelete(t, ShadowLayerGroup)
}) })
t.Run("Substitution", func(t *testing.T) { t.Run("Substitution", func(t *testing.T) {
ds1LayersDelete(t, Substitutionlayergroup) ds1LayersDelete(t, SubstitutionLayerGroup)
}) })
} }
@ -42,7 +42,7 @@ func ds1LayersDelete(t *testing.T, lt LayerGroupType) {
del = func(i int) { ds1.DeleteWall(0) } del = func(i int) { ds1.DeleteWall(0) }
case ShadowLayerGroup: case ShadowLayerGroup:
del = func(i int) { ds1.DeleteShadow(0) } del = func(i int) { ds1.DeleteShadow(0) }
case Substitutionlayergroup: case SubstitutionLayerGroup:
del = func(i int) { ds1.DeleteSubstitution(0) } del = func(i int) { ds1.DeleteSubstitution(0) }
default: default:
t.Fatal("unknown layer type given") t.Fatal("unknown layer type given")
@ -67,7 +67,7 @@ func Test_ds1Layers_Get(t *testing.T) {
ds1LayersGet(t, ShadowLayerGroup) ds1LayersGet(t, ShadowLayerGroup)
}) })
t.Run("Substitution", func(t *testing.T) { t.Run("Substitution", func(t *testing.T) {
ds1LayersGet(t, Substitutionlayergroup) ds1LayersGet(t, SubstitutionLayerGroup)
}) })
} }
@ -83,7 +83,7 @@ func ds1LayersGet(t *testing.T, lt LayerGroupType) {
get = func(i int) *Layer { return ds1.GetWall(0) } get = func(i int) *Layer { return ds1.GetWall(0) }
case ShadowLayerGroup: case ShadowLayerGroup:
get = func(i int) *Layer { return ds1.GetShadow(0) } get = func(i int) *Layer { return ds1.GetShadow(0) }
case Substitutionlayergroup: case SubstitutionLayerGroup:
get = func(i int) *Layer { return ds1.GetSubstitution(0) } get = func(i int) *Layer { return ds1.GetSubstitution(0) }
default: default:
t.Fatal("unknown layer type given") t.Fatal("unknown layer type given")
@ -93,7 +93,7 @@ func ds1LayersGet(t *testing.T, lt LayerGroupType) {
layer := get(0) layer := get(0)
// example has nil substitution layer, maybe we need another test // example has nil substitution layer, maybe we need another test
if layer == nil && lt != Substitutionlayergroup { if layer == nil && lt != SubstitutionLayerGroup {
t.Errorf("layer expected") t.Errorf("layer expected")
} }
} }
@ -109,7 +109,7 @@ func Test_ds1Layers_Insert(t *testing.T) {
ds1LayersInsert(t, ShadowLayerGroup) ds1LayersInsert(t, ShadowLayerGroup)
}) })
t.Run("Substitution", func(t *testing.T) { t.Run("Substitution", func(t *testing.T) {
ds1LayersInsert(t, Substitutionlayergroup) ds1LayersInsert(t, SubstitutionLayerGroup)
}) })
} }
@ -140,7 +140,7 @@ func ds1LayersInsert(t *testing.T, lt LayerGroupType) {
insert = func(i int) { ds1.InsertWall(0, layers[i]) } insert = func(i int) { ds1.InsertWall(0, layers[i]) }
case ShadowLayerGroup: case ShadowLayerGroup:
insert = func(i int) { ds1.InsertShadow(0, layers[i]) } insert = func(i int) { ds1.InsertShadow(0, layers[i]) }
case Substitutionlayergroup: case SubstitutionLayerGroup:
insert = func(i int) { ds1.InsertSubstitution(0, layers[i]) } insert = func(i int) { ds1.InsertSubstitution(0, layers[i]) }
default: default:
t.Fatal("unknown layer type given") t.Fatal("unknown layer type given")
@ -177,7 +177,7 @@ func Test_ds1Layers_Pop(t *testing.T) {
}) })
t.Run("Substitution", func(t *testing.T) { t.Run("Substitution", func(t *testing.T) {
ds1layerPop(Substitutionlayergroup, t) ds1layerPop(SubstitutionLayerGroup, t)
}) })
} }
@ -213,7 +213,7 @@ func ds1layerPop(lt LayerGroupType, t *testing.T) {
return l return l
} }
case Substitutionlayergroup: case SubstitutionLayerGroup:
numBefore = len(ds1.Substitutions) numBefore = len(ds1.Substitutions)
pop = func() *Layer { pop = func() *Layer {
l := ds1.PopSubstitution() l := ds1.PopSubstitution()
@ -257,7 +257,7 @@ func Test_ds1Layers_Push(t *testing.T) {
}) })
t.Run("Substitution", func(t *testing.T) { t.Run("Substitution", func(t *testing.T) {
ds1layerPush(Substitutionlayergroup, t) ds1layerPush(SubstitutionLayerGroup, t)
}) })
} }
@ -306,7 +306,7 @@ func ds1layerPush(lt LayerGroupType, t *testing.T) { //nolint:funlen // no biggi
get = layers.GetShadow get = layers.GetShadow
max = maxShadowLayers max = maxShadowLayers
group = &layers.Shadows group = &layers.Shadows
case Substitutionlayergroup: case SubstitutionLayerGroup:
push = func() { layers.PushSubstitution(&Layer{}) } push = func() { layers.PushSubstitution(&Layer{}) }
get = layers.GetSubstitution get = layers.GetSubstitution
max = maxSubstitutionLayers max = maxSubstitutionLayers