package door import "bytes" type Screen struct { Panels []Panel } func (s *Screen) AddPanel(panel Panel) { s.Panels = append(s.Panels, panel) } func (s *Screen) Output() []byte { var result bytes.Buffer for idx := range s.Panels { result.Write(s.Panels[idx].Output()) } return result.Bytes() } func (s *Screen) Update() []byte { var result bytes.Buffer for idx := range s.Panels { result.Write(s.Panels[idx].Update()) } return result.Bytes() }