33 lines
674 B
Go
33 lines
674 B
Go
|
package skirdagame
|
||
|
|
||
|
import "errors"
|
||
|
|
||
|
type SkirdaGame interface {
|
||
|
GetSkirdaGameId() string
|
||
|
GetInterfaceAsset() GameUIAssets
|
||
|
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("")
|
||
|
}
|