]> git.scottworley.com Git - planeteer/commitdiff
Some safety against future modifications in DimensionSizes().
authorScott Worley <sworley@chkno.net>
Wed, 26 Oct 2011 04:12:26 +0000 (21:12 -0700)
committerScott Worley <sworley@chkno.net>
Wed, 26 Oct 2011 04:12:26 +0000 (21:12 -0700)
planeteer.go

index 5acf98fd87b3179ec9e1638c7096052f6229dbef..314a3b62e62c18a4a8a7f259c33df374ffe6214b 100644 (file)
@@ -142,6 +142,13 @@ func DimensionSizes(data planet_data) []int {
        dims[NeedFighters] = bint(*drones > 0) + 1
        dims[NeedShields] = bint(*batteries > 0) + 1
        dims[Visit] = 1 << uint(len(visit()))
        dims[NeedFighters] = bint(*drones > 0) + 1
        dims[NeedShields] = bint(*batteries > 0) + 1
        dims[Visit] = 1 << uint(len(visit()))
+
+       // Remind myself to add a line above when adding new dimensions
+       for i, dim := range dims {
+               if dim < 1 {
+                       panic(i)
+               }
+       }
        return dims
 }
 
        return dims
 }