screen.go 411 B

12345678910111213141516171819202122232425
  1. package door
  2. type Screen struct {
  3. Panels []Panel
  4. }
  5. func (s *Screen) AddPanel(panel Panel) {
  6. s.Panels = append(s.Panels, panel)
  7. }
  8. func (s *Screen) Output() string {
  9. var result string
  10. for idx := range s.Panels {
  11. result += s.Panels[idx].Output()
  12. }
  13. return result
  14. }
  15. func (s *Screen) Update() string {
  16. var result string
  17. for idx := range s.Panels {
  18. result += s.Panels[idx].Update()
  19. }
  20. return result
  21. }