ebitengine updater
This commit is contained in:
@@ -9,16 +9,23 @@ type SoftwareUpdaterServiceInterface interface {
|
||||
}
|
||||
|
||||
type SoftwareUpdaterService struct {
|
||||
tic80Updater SoftwareUpdaterTIC80ServiceInterface
|
||||
tic80Updater SoftwareUpdaterTIC80ServiceInterface
|
||||
ebitengineUpdater SoftwareUpdaterEbitengineServiceInterface
|
||||
}
|
||||
|
||||
func NewSoftwareUpdaterService(tic80_updater SoftwareUpdaterTIC80ServiceInterface) *SoftwareUpdaterService {
|
||||
return &SoftwareUpdaterService{tic80Updater: tic80_updater}
|
||||
func NewSoftwareUpdaterService(tic80_updater SoftwareUpdaterTIC80ServiceInterface, ebitengine_updater SoftwareUpdaterEbitengineServiceInterface) *SoftwareUpdaterService {
|
||||
return &SoftwareUpdaterService{
|
||||
tic80Updater: tic80_updater,
|
||||
ebitengineUpdater: ebitengine_updater,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *SoftwareUpdaterService) Update(platform, name, version string) error {
|
||||
if platform == "tic80" {
|
||||
return s.tic80Updater.Update(name, version)
|
||||
}
|
||||
if platform == "ebitengine" {
|
||||
return s.ebitengineUpdater.Update(name, version)
|
||||
}
|
||||
return fmt.Errorf("unsupported platform: %s", platform)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user