Documentation
¶
Overview ¶
Package repdecoder implements decoding StarCraft Brood War replay files (*.rep).
SC BW replays are basically divided into 2 types:
- modern (starting from 1.18)
- legacy (pre 1.18)
The type detection and utilization of the proper decoder is automatic and transparent to the package user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMismatchedSection is returned by Decoder.Section() if the section size is not the expected one ErrMismatchedSection = errors.New("mismatched section") // ErrNoMoreSections is returned by Decoder.NewSection() if there are no more sections. ErrNoMoreSections = errors.New("no more sections") )
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
// RepFormat returns the replay format
RepFormat() RepFormat
// NewSection must be called between sections.
// ErrNoMoreSections is returned if the replay has no more sections.
NewSection() error
// Section decodes a section of the given size.
Section(size int32) (data []byte, sectionID int32, err error)
// Close closes the decoder, releases any associated resources.
io.Closer
}
Decoder wraps a Section method for decoding a section of a given size.
func NewFromFile ¶
NewFromFile creates a new Decoder that reads and decompresses data form a file.
Click to show internal directories.
Click to hide internal directories.