|
@@ -21,7 +21,7 @@ type StarField struct {
|
|
|
RNG *rand.Rand
|
|
|
MX int
|
|
|
MY int
|
|
|
- Sky map[StarPos]bool
|
|
|
+ Sky map[StarPos]struct{}
|
|
|
}
|
|
|
|
|
|
func (s *StarField) make_pos() StarPos {
|
|
@@ -37,7 +37,7 @@ func (s *StarField) make_pos() StarPos {
|
|
|
func (s *StarField) Regenerate() {
|
|
|
s.MX = door.Width
|
|
|
s.MY = door.Height
|
|
|
- s.Sky = make(map[StarPos]bool)
|
|
|
+ s.Sky = make(map[StarPos]struct{})
|
|
|
|
|
|
s.RNG = rand.New(mt19937.New())
|
|
|
s.RNG.Seed(time.Now().UnixNano())
|
|
@@ -47,7 +47,7 @@ func (s *StarField) Regenerate() {
|
|
|
pos := s.make_pos()
|
|
|
pos.Symbol = i % 2
|
|
|
pos.Color = i%5 < 2
|
|
|
- s.Sky[pos] = true
|
|
|
+ s.Sky[pos] = struct{}{}
|
|
|
}
|
|
|
}
|
|
|
|