1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-23 06:35:24 +00:00
neonmodem/ui/ctx/ctx.go

35 lines
548 B
Go
Raw Normal View History

2022-12-29 03:22:36 +00:00
package ctx
import (
"github.com/mrusme/gobbs/config"
"github.com/mrusme/gobbs/system"
"go.uber.org/zap"
)
2022-12-29 03:22:36 +00:00
type Ctx struct {
Screen [2]int
Content [2]int
Config *config.Config
2022-12-29 03:22:36 +00:00
Systems []*system.System
Loading bool
Logger *zap.SugaredLogger
2022-12-29 03:22:36 +00:00
}
func New(
cfg *config.Config,
logger *zap.SugaredLogger,
) Ctx {
2022-12-29 03:22:36 +00:00
return Ctx{
Screen: [2]int{0, 0},
Content: [2]int{0, 0},
Config: cfg,
2022-12-29 03:22:36 +00:00
Loading: false,
Logger: logger,
2022-12-29 03:22:36 +00:00
}
}
func (c *Ctx) AddSystem(sys *system.System) error {
c.Systems = append(c.Systems, sys)
return nil
}