osu

package
v0.0.0-...-f5ac437 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	HitTypeNote = 1 << iota
	HitTypeSlider
	NewCombo
	HitTypeSpinner
	ComboColourSkip1
	ComboColourSkip2
	ComboColourSkip3
	HitTypeHoldNote
)
View Source
const (
	HitSoundNormal = iota
	HitSoundWhistle
	HitSoundFinish
	HitSoundClap
)
View Source
const (
	TaikoKatMask = HitSoundWhistle | HitSoundClap
	TaikoDonMask = ^TaikoKatMask // TODO: need a test
	TaikoBigMask = HitSoundFinish
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Colours

type Colours struct {
	Combos              [8]color.RGBA
	SliderTrackOverride color.RGBA
	SliderBorder        color.RGBA
}

type Difficulty

type Difficulty struct {
	HPDrainRate       float64 `json:"hpDrainRate"`
	CircleSize        float64 `json:"circleSize"`
	OverallDifficulty float64 `json:"overallDifficulty"`
	ApproachRate      float64 `json:"approachRate"`
	SliderMultiplier  float64 `json:"sliderMultiplier"`
	SliderTickRate    float64 `json:"sliderTickRate"`
}

type Editor

type Editor struct {
	Bookmarks       []int   // delimiter,
	DistanceSpacing float64 `json:"distanceSpacing"`
	BeatDivisor     float64 `json:"beatDivisor"`
	GridSize        int     `json:"gridSize"`
	TimelineZoom    float64 `json:"timelineZoom"`
}

type Event

type Event struct {
	Type      string
	StartTime int
	EndTime   int // optional
	Filename  string
	XOffset   int
	YOffset   int
}

storyboard not implemented yet

type Events

type Events []Event

func (Events) Background

func (es Events) Background() (Event, bool)

func (Events) Video

func (es Events) Video() (Event, bool)

type Format

type Format struct {
	FormatVersion int `json:"formatVersion"`
	General
	Editor
	Metadata
	Difficulty
	Events
	TimingPoints
	Colours
	HitObjects
}

func Parse

func Parse(path string) (*Format, error)

type General

type General struct {
	AudioFilename            string  `json:"audioFilename"`
	AudioLeadIn              int     `json:"audioLeadIn"`
	AudioHash                string  `json:"audioHash"` // deprecated
	PreviewTime              int     `json:"previewTime"`
	Countdown                int     `json:"countdown"` // nofloat
	SampleSet                string  `json:"sampleSet"`
	StackLeniency            float64 `json:"stackLeniency"`
	Mode                     int     `json:"mode"` // nofloat
	LetterboxInBreaks        bool    `json:"letterboxInBreaks"`
	StoryFireInFront         bool    `json:"storyFireInFront"` // deprecated
	UseSkinSprites           bool    `json:"useSkinSprites"`
	AlwaysShowPlayfield      bool    `json:"alwaysShowPlayfield"` // deprecated
	OverlayPosition          string  `json:"overlayPosition"`
	SkinPreference           string  `json:"skinPreference"`
	EpilepsyWarning          bool    `json:"epilepsyWarning"`
	CountdownOffset          int     `json:"countdownOffset"`
	SpecialStyle             bool    `json:"specialStyle"`
	WidescreenStoryboard     bool    `json:"widescreenStoryboard"`
	SamplesMatchPlaybackRate bool    `json:"samplesMatchPlaybackRate"`
}

type HitObject

type HitObject struct {
	X            int          `json:"x"`
	Y            int          `json:"y"`
	Time         int          `json:"time"`
	NoteType     int          `json:"noteType"` // nofloat
	HitSound     int          `json:"hitSound"` // nofloat
	EndTime      int          `json:"endTime"`  // optional
	SliderParams SliderParams // optional
	HitSample    HitSample    // optional
}

func (HitObject) Column

func (ho HitObject) Column(columnCount int) int

Column returns index of column at mania playfield

func (HitObject) SliderDuration

func (ho HitObject) SliderDuration(tps []TimingPoint, multiplier float64) int

TODO: need a test

type HitObjects

type HitObjects []HitObject

type HitSample

type HitSample struct {
	NormalSet   int    `json:"normalSet"`   // nofloat
	AdditionSet int    `json:"additionSet"` // nofloat
	Index       int    `json:"index"`       // nofloat
	Volume      int    `json:"volume"`
	Filename    string `json:"filename"`
}

func (HitSample) SampleFilename

func (hs HitSample) SampleFilename(sampleSet, hitSound int) string

TODO: test yet supposed whether normal or additional sample set is input in every call

type Metadata

type Metadata struct {
	Title         string   `json:"title"`
	TitleUnicode  string   `json:"titleUnicode"`
	Artist        string   `json:"artist"`
	ArtistUnicode string   `json:"artistUnicode"`
	Creator       string   `json:"creator"`
	Version       string   `json:"version"`
	Source        string   `json:"source"`
	Tags          []string // delimiter(space)
	BeatmapID     int      `json:"beatmapID"`    // nofloat
	BeatmapSetID  int      `json:"beatmapSetID"` // nofloat
}

type SliderParams

type SliderParams struct {
	CurveType   string   `json:"curveType"` // one letter
	CurvePoints [][2]int // delimiter| // delimiter: // slice of paired integers
	Slides      int      `json:"slides"`
	Length      float64  `json:"length"`
	EdgeSounds  []int    // delimiter|
	EdgeSets    [][2]int // delimiter| // delimiter:
}

type TimingPoint

type TimingPoint struct {
	Time        int     `json:"time"`
	BeatLength  float64 `json:"beatLength"`
	Meter       int     `json:"meter"`
	SampleSet   int     `json:"sampleSet"`   // nofloat
	SampleIndex int     `json:"sampleIndex"` // nofloat
	Volume      int     `json:"volume"`
	Uninherited bool    `json:"uninherited"`
	Effects     int     `json:"effects"` // nofloat
}

func (TimingPoint) BPM

func (tp TimingPoint) BPM() (bpm float64, ok bool)

func (TimingPoint) IsInherited

func (tp TimingPoint) IsInherited() bool

func (TimingPoint) IsKiai

func (tp TimingPoint) IsKiai() bool

func (TimingPoint) SpeedFactor

func (tp TimingPoint) SpeedFactor() (speed float64, ok bool)

SpeedFactor returns a speed factor. The standard value is 1.

type TimingPoints

type TimingPoints []TimingPoint

Jump to

Keyboard shortcuts

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