mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-14 00:06:45 -05:00
2.4 KiB
2.4 KiB
diff --git a/d2common/d2fileformats/d2ds1/ds1_test.go b/d2common/d2fileformats/d2ds1/ds1_test.go
index 23035a50..d17527f0 100644
--- a/d2common/d2fileformats/d2ds1/ds1_test.go
+++ b/d2common/d2fileformats/d2ds1/ds1_test.go
@@ -575,6 +575,24 @@ func TestDS1_SetNumberOfFloors(t *testing.T) {
if err := testIfRestorable(ds1, test); err != nil {
t.Errorf("unable to restore: %v", err)
}
+
+ newNumber = 10
+
+ ds1.SetNumberOfFloorLayers(newNumber)
+
+ test = func(ds1 *DS1) {
+ if len(ds1.tiles[0][0].Floors) != int(newNumber) {
+ t.Fatal("unexpected floors length set")
+ }
+
+ if ds1.numberOfFloorLayers != newNumber {
+ t.Fatal("unexpected floors length set")
+ }
+ }
+
+ if err := testIfRestorable(ds1, test); err != nil {
+ t.Errorf("unable to restore: %v", err)
+ }
}
func TestDS1_NumberOfShadowLayers(t *testing.T) {
diff --git a/d2common/d2fileformats/d2ds1/layers.go b/d2common/d2fileformats/d2ds1/layers.go
index f69ef7f1..b0488a34 100644
--- a/d2common/d2fileformats/d2ds1/layers.go
+++ b/d2common/d2fileformats/d2ds1/layers.go
@@ -1 +1,39 @@
package d2ds1
+
+const (
+ maxWalls = 4
+)
+
+type WallLayer [][]*Wall
+type FloorLayer [][]*Floor
+type ShadowLayer [][]*Shadow
+
+type layers struct {
+ Walls []WallLayer
+ Floors []FloorLayer
+ Shadows []ShadowLayer
+}
+
+func (l *layers) PushWallLayer() {
+
+}
+
+func (l *layers) PopWallLayer() WallLayer {
+
+}
+
+func (l *layers) PushFloorLayer() {
+
+}
+
+func (l *layers) PopFloorLayer() FloorLayer {
+
+}
+
+func (l *layers) PushShadowLayer() {
+
+}
+
+func (l *layers) PopShadowLayer() ShadowLayer {
+
+}
index 23035a50..d17527f0 100644
--- a/d2common/d2fileformats/d2ds1/ds1_test.go
+++ b/d2common/d2fileformats/d2ds1/ds1_test.go
@@ -575,6 +575,24 @@ func TestDS1_SetNumberOfFloors(t *testing.T) {
if err := testIfRestorable(ds1, test); err != nil {
t.Errorf("unable to restore: %v", err)
}
+
+ newNumber = 10
+
+ ds1.SetNumberOfFloorLayers(newNumber)
+
+ test = func(ds1 *DS1) {
+ if len(ds1.tiles[0][0].Floors) != int(newNumber) {
+ t.Fatal("unexpected floors length set")
+ }
+
+ if ds1.numberOfFloorLayers != newNumber {
+ t.Fatal("unexpected floors length set")
+ }
+ }
+
+ if err := testIfRestorable(ds1, test); err != nil {
+ t.Errorf("unable to restore: %v", err)
+ }
}
func TestDS1_NumberOfShadowLayers(t *testing.T) {
diff --git a/d2common/d2fileformats/d2ds1/layers.go b/d2common/d2fileformats/d2ds1/layers.go
index f69ef7f1..b0488a34 100644
--- a/d2common/d2fileformats/d2ds1/layers.go
+++ b/d2common/d2fileformats/d2ds1/layers.go
@@ -1 +1,39 @@
package d2ds1
+
+const (
+ maxWalls = 4
+)
+
+type WallLayer [][]*Wall
+type FloorLayer [][]*Floor
+type ShadowLayer [][]*Shadow
+
+type layers struct {
+ Walls []WallLayer
+ Floors []FloorLayer
+ Shadows []ShadowLayer
+}
+
+func (l *layers) PushWallLayer() {
+
+}
+
+func (l *layers) PopWallLayer() WallLayer {
+
+}
+
+func (l *layers) PushFloorLayer() {
+
+}
+
+func (l *layers) PopFloorLayer() FloorLayer {
+
+}
+
+func (l *layers) PushShadowLayer() {
+
+}
+
+func (l *layers) PopShadowLayer() ShadowLayer {
+
+}