savesStats

package
v0.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapStats

type MapStats struct {
	//RecordTime   time.Time
	TotalKills   uint32 `json:"totalkills"`
	KillCount    uint32 `json:"killcount"`
	TotalSecrets uint32 `json:"totalsecrets"`
	SecretCount  uint32 `json:"secretcount"`
	LevelTime    uint32 `json:"leveltime"`

	TotalItems uint32 `json:"totalitems"`
	ItemCount  uint32 `json:"itemcount"`
	LevelName  string `json:"levelname"`
}

MapStats contains the stats for one single level read from a savegame

func GetBoomStats

func GetBoomStats(path string) ([]MapStats, error)

func GetChocolateStats

func GetChocolateStats(path string) ([]MapStats, error)

Crispy / Chocolate

func GetZDoomStats

func GetZDoomStats(path string) []MapStats

GetZDoomStats returns a slice of MapStats Tries to parse json first If that doesn't work falls back to old binary mode (zandronum)

func SummarizeStats

func SummarizeStats(stats []MapStats) (total MapStats)

SummarizeStats sums up a slice of stats to a total one

type SaveMeta

type SaveMeta struct {
	Software    string `json:"Software"`
	Engine      string `json:"Engine"`
	SaveVersion int    `json:"Save Version"`
	Title       string `json:"Title"`
	CurrentMap  string `json:"Current Map"`
	GameWAD     string `json:"Game WAD"`
	MapWAD      string `json:"Map WAD"`
	Comment     string `json:"Comment"`
}

SaveMeta is metainformatino such as given name for a savegame

func ChocolateMetaFromBinary

func ChocolateMetaFromBinary(path string) (SaveMeta, error)

func GetZDoomSaveMeta

func GetZDoomSaveMeta(path string) SaveMeta

GetZDoomSaveMeta returns a slice of SaveMeta Tries to parse json first If that doesn't work falls back to old binary mode (zandronum)

type Savegame

type Savegame struct {
	FI        os.FileInfo
	Directory string
	Name      string
	Slot      int
	Meta      SaveMeta
	Levels    []MapStats `json:"levels"`
}

Savegame saves a dual purpose Is a nested struct piece to easily parse zdoom savegame stats Represents a games savegame and some of it's properties

func NewSavegame

func NewSavegame(fi os.DirEntry, dir string) Savegame

NewSavegame initializes a new Savegame struct

func (Savegame) ReversedLevels

func (save Savegame) ReversedLevels() (r []MapStats)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL