filesystem

package
v0.0.0-...-1953d82 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GameBasePath deprecated

func GameBasePath() string

Deprecated: Use Engine.FileSystem() instead

func GameInfo deprecated

func GameInfo() *keyvalues.KeyValue

Deprecated: Store gameInfo in Engine context instead

Types

type FileSystem

type FileSystem interface {
	// GetFile searches for a file path
	GetFile(string) (io.Reader, error)
	// RegisterPakFile adds a bsp pakfile to the filesystem search paths
	RegisterPakFile(pakFile filesystemLib.PakFile)
}

FileSystem provides a gateway to interacting with the filesystem structures of Source Engine.

func Get deprecated

func Get() FileSystem

Deprecated: Use Engine.FileSystem() instead of this global singleton. This function will be removed in a future version. For new code, pass FileSystem as an explicit dependency via constructors.

func Init

func Init(gameDir string) (FileSystem, error)

Init initialises the master filesystem used by Kero. In theory other filesystems can be used too; but the master fs is designed to be loaded with the same configuration and behaviour as the original Source Engine.

func InitializeFromGameInfoDefinitions

func InitializeFromGameInfoDefinitions(basePath string, gameInfo *keyvalues.KeyValue) (FileSystem, error)

InitializeFromGameInfoDefinitions Reads game resource data paths from GameInfo.txt All games should ship with a gameinfo.txt, but it isn't actually mandatory.

Jump to

Keyboard shortcuts

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