Documentation ¶
Index ¶
- func AddGame(g Game)
- func GameCount() int
- func InformChangeListeners()
- func MaxModCount() int
- func Persist() error
- func RegisterChangeListener(f func())
- func RemoveGameAt(i int)
- func SortAlph()
- type Game
- func (g *Game) AddMod(modFile string)
- func (g *Game) CommandList() (command []string)
- func (g *Game) DemoCount() int
- func (g *Game) DemoExists(name string) bool
- func (g *Game) Demos() ([]os.DirEntry, error)
- func (g *Game) EnvironmentString() string
- func (g *Game) GetSaveMeta(savePath string) st.SaveMeta
- func (g *Game) GetStats(savePath string) []st.MapStats
- func (g *Game) GoToMap(mapName string, skill int) (err error)
- func (g *Game) GoToMapRecord(mapName string, skill int, demoName string) (err error)
- func (g *Game) LoadSavegames() []*st.Savegame
- func (g Game) ModMaps() map[string]string
- func (g *Game) ParamsString() string
- func (g *Game) PlayDemo(name string)
- func (g *Game) Quickload() (err error)
- func (g *Game) Rate(increment int)
- func (g *Game) RatingString() string
- func (g *Game) ReadLatestStats()
- func (g *Game) RemoveDemo(name string) ([]os.DirEntry, error)
- func (g *Game) RemoveMod(i int)
- func (g *Game) Run() (err error)
- func (g *Game) SaveCount() int
- func (g *Game) SwitchMods(a, b int)
- func (g *Game) Warp(episode, level, skill int) (err error)
- func (g *Game) WarpRecord(episode, level, skill int, demoName string) (err error)
- type GameList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGame ¶
func AddGame(g Game)
AddGame adds a game to the list this triggers the list to be written to disk as well
func InformChangeListeners ¶ added in v0.5.0
func InformChangeListeners()
InformChangeListeners triggers the given function for each registered listener
func MaxModCount ¶
func MaxModCount() int
MaxModCount returns the biggest number of mods for a single game this is useful for table creation, to know how many colums one needs
func RegisterChangeListener ¶
func RegisterChangeListener(f func())
RegisterChangeListener takes functions, that should get executed once configuration change
Types ¶
type Game ¶
type Game struct { Name string `json:"name"` Port string `json:"source_port"` Iwad string `json:"iwad"` Environment []string `json:"environment"` Mods []string `json:"mods"` CustomParameters []string `json:"custom_parameters"` ConsoleStats map[string]int `json:"stats"` Playtime int64 `json:"playtime"` LastPlayed string `json:"last_played"` SaveGameCount int `json:"save_game_count"` Rating int `json:"rating"` AddEdit time.Time `json:"added"` Link string `json:"link"` PersonalPortCfg bool `json:"own_source_port_cfg"` Stats []st.MapStats StatsTotal st.MapStats Savegames []*st.Savegame }
Game represents one game configuration
func (*Game) CommandList ¶ added in v0.7.0
CommandList returns the full slice of strings in order to launch the game
func (*Game) DemoCount ¶ added in v0.8.0
DemoCount returns the number of demos existing for this game
func (*Game) DemoExists ¶ added in v0.8.0
DemoExists checks if a file with the same name already exists in the default demo dir Doesn't use standard library to ignore file ending; design decision
func (*Game) EnvironmentString ¶ added in v0.5.0
EnvironmentString returns a join of all prefix parameters
func (*Game) GetSaveMeta ¶ added in v0.15.0
GetSaveMeta reads meta information for the given savegame
func (*Game) GetStats ¶ added in v0.15.0
GetStats reads stats from the given savegame path for zdoom ports If the port is boom or chocolate, their respective dump-files are used
func (*Game) GoToMap ¶ added in v0.19.0
GoToMap lets you select a specific map from a mod based on it's name Just a wrapper for game.run
func (*Game) GoToMapRecord ¶ added in v0.19.0
GoToMapRecord lets you select a specific map from a mod based on it's name Just a wrapper for game.run
func (*Game) LoadSavegames ¶ added in v0.15.0
LoadSavegames returns a slice of Savegames for the game
func (*Game) ParamsString ¶ added in v0.5.0
ParamsString returns a join of all custom parameters
func (*Game) Quickload ¶ added in v0.7.0
Quickload starts the game from it's last savegame Just a wrapper for game.run
func (*Game) RatingString ¶ added in v0.7.0
RatingString returns the string resulting from the games rating
func (*Game) ReadLatestStats ¶ added in v0.15.0
func (g *Game) ReadLatestStats()
ReadLatestStats tries to read stats from the newest existing savegame
func (*Game) RemoveDemo ¶ added in v0.8.0
RemoveDemo removes the demo file with the given name and returns the new set of demos
func (*Game) Run ¶
Run executes given configuration and launches the mod Just a wrapper for game.run
func (*Game) SaveCount ¶ added in v0.2.1
SaveCount returns the number of savegames existing for this game
func (*Game) SwitchMods ¶ added in v0.7.0
SwitchMods switches both entries within the mod slice