sharedutils/games/skirdagame/skirdagame.go
2023-01-30 09:23:23 +03:00

44 lines
817 B
Go

package skirdagame
import "errors"
type SkirdaGame interface {
GetSkirdaGameId() string
GetUIAssets() GameUIAssets
GetLaunchArgs() []string
GetType() string
GetArguments() Arguments
}
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("")
}
type Argument struct {
Body string
Value string
}
type Arguments struct {
Required []Argument
Optional []Argument
}