sharedutils/games/skirdagame/skirdagame.go

33 lines
668 B
Go
Raw Normal View History

2023-01-24 13:46:17 +00:00
package skirdagame
import "errors"
type SkirdaGame interface {
GetSkirdaGameId() string
2023-01-30 04:43:46 +00:00
GetUIAssets() GameUIAssets
2023-01-24 13:46:17 +00:00
GetLaunchArgs() []string
GetType() string
}
type GameUIAssets struct {
// GameID string `json:"gameId"`
Title string `json:"title"`
Icon string `json:"icon"`
Description string `json:"description"`
}
type SkirdaGames []SkirdaGame
func (games SkirdaGames) AddGames(game []SkirdaGame) {
games = append(games, game...)
}
func (games SkirdaGames) FindGameByID(gameId string) (SkirdaGame, error) {
for _, game := range games {
if game.GetSkirdaGameId() == gameId {
return game, nil
}
}
return nil, errors.New("")
}