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
|
2023-01-30 06:23:17 +00:00
|
|
|
GetArguments() Arguments
|
2023-01-24 13:46:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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("")
|
|
|
|
}
|
2023-01-30 06:23:17 +00:00
|
|
|
|
|
|
|
type Argument struct {
|
|
|
|
Body string
|
|
|
|
Value string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Arguments struct {
|
|
|
|
Required []Argument
|
|
|
|
Optional []Argument
|
|
|
|
}
|