beatsaber

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLightingEvent

func IsLightingEvent(e EventType) bool

Types

type BPMChange

type BPMChange struct {
	Time            Time    `json:"_time"`
	BPM             float64 `json:"_BPM"`
	BeatsPerBar     int     `json:"_beatsPerBar"`
	MetronomeOffset int     `json:"_metronomeOffset"`

	Extra map[string]*json.RawMessage `json:"-"`
}

type Beatmap

type Beatmap struct {
	Difficulty     BeatmapDifficulty `json:"_difficulty"`
	DifficultyRank int               `json:"_difficultyRank"`
	Filename       string            `json:"_beatmapFilename"`
	NJS            float64           `json:"_noteJumpMovementSpeed"`
	Offset         float64           `json:"_noteJumpStartBeatOffset"`
}

type BeatmapDifficulty

type BeatmapDifficulty string
const (
	BeatmapDifficultyEasy       BeatmapDifficulty = "Easy"
	BeatmapDifficultyNormal     BeatmapDifficulty = "Normal"
	BeatmapDifficultyHard       BeatmapDifficulty = "Hard"
	BeatmapDifficultyExpert     BeatmapDifficulty = "Expert"
	BeatmapDifficultyExpertPlus BeatmapDifficulty = "ExpertPlus"
)

type BeatmapSet

type BeatmapSet struct {
	Characteristic Characteristic `json:"_beatmapCharacteristicName"`
	Beatmaps       []Beatmap      `json:"_difficultyBeatmaps"`
}

type Characteristic

type Characteristic string
const (
	CharacteristicStandard  Characteristic = "Standard"
	CharacteristicNoArrows  Characteristic = "NoArrows"
	CharacteristicOneSaber  Characteristic = "OneSaber"
	Characteristic360Degree Characteristic = "360Degree"
	Characteristic90Degree  Characteristic = "90Degree"
	CharacteristicLightshow Characteristic = "Lightshow"
	CharacteristicLawless   Characteristic = "Lawless"
)

type CustomData

type CustomData interface {
	json.Marshaler
}

type CutDirection

type CutDirection int

type Difficulty

type Difficulty struct {
	Version string  `json:"_version"`
	Notes   []Note  `json:"_notes"`
	Events  []Event `json:"_events"`

	CustomData DifficultyCustomData `json:"_customData"`

	Extra map[string]*json.RawMessage `json:"-"`
}

func (Difficulty) MarshalJSON

func (d Difficulty) MarshalJSON() ([]byte, error)

func (*Difficulty) UnmarshalJSON

func (d *Difficulty) UnmarshalJSON(raw []byte) error

type DifficultyCustomData

type DifficultyCustomData struct {
	BPMChanges []BPMChange `json:"_BPMChanges"`

	Extra map[string]*json.RawMessage `json:"-"`
}

func (DifficultyCustomData) MarshalJSON

func (dcd DifficultyCustomData) MarshalJSON() ([]byte, error)

func (*DifficultyCustomData) UnmarshalJSON

func (dcd *DifficultyCustomData) UnmarshalJSON(raw []byte) error

type EnvColor

type EnvColor struct {
	R float64 `json:"r"`
	G float64 `json:"g"`
	B float64 `json:"b"`
}

type EnvColorScheme

type EnvColorScheme struct {
	ColorLeft          EnvColor `json:"_colorLeft"`
	ColorRight         EnvColor `json:"_colorRight"`
	EnvColorLeft       EnvColor `json:"_envColorLeft"`
	EnvColorRight      EnvColor `json:"_envColorRight"`
	ObstacleColor      EnvColor `json:"_obstacleColor"`
	EnvColorLeftBoost  EnvColor `json:"_envColorLeftBoost"`
	EnvColorRightBoost EnvColor `json:"_envColorRightBoost"`
}

type EnvPosition

type EnvPosition struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	Z float64 `json:"z"`
}

type EnvProfile

type EnvProfile struct {
	ColorScheme EnvColorScheme        `json:"colorScheme"`
	Props       map[string][]EnvProp  `json:"props"`
	PropGroup   map[int]map[int][]int `json:"-"`
}

func LoadEnv

func LoadEnv(envName string) (*EnvProfile, error)

func (*EnvProfile) MaxLightID

func (p *EnvProfile) MaxLightID(eventType EventType) int

type EnvProp

type EnvProp struct {
	Type     int         `json:"_type"`
	PropID   int         `json:"_propId"`
	LightID  int         `json:"_lightId"`
	Name     string      `json:"name"`
	Position EnvPosition `json:"position"`
}

type EnvironmentName

type EnvironmentName string
const (
	EnvironmentBigMirror       EnvironmentName = "BigMirrorEnvironment"
	EnvironmentBTS             EnvironmentName = "BTSEnvironment"
	EnvironmentCrabRave        EnvironmentName = "CrabRaveEnvironment"
	EnvironmentDefault         EnvironmentName = "DefaultEnvironment"
	EnvironmentDragons         EnvironmentName = "DragonsEnvironment"
	EnvironmentFitBeat         EnvironmentName = "FitBeatEnvironment"
	EnvironmentGlassDesert     EnvironmentName = "GlassDesertEnvironment"
	EnvironmentGreenDay        EnvironmentName = "GreenDayEnvironment"
	EnvironmentGreenDayGrenade EnvironmentName = "GreenDayGrenadeEnvironment"
	EnvironmentInterscope      EnvironmentName = "InterscopeEnvironment"
	EnvironmentKaleidoscope    EnvironmentName = "KaleidoscopeEnvironment"
	EnvironmentKDA             EnvironmentName = "KDAEnvironment"
	EnvironmentLinkinPark      EnvironmentName = "LinkinParkEnvironment"
	EnvironmentMonstercat      EnvironmentName = "MonstercatEnvironment"
	EnvironmentNice            EnvironmentName = "NiceEnvironment"
	EnvironmentOrigins         EnvironmentName = "OriginsEnvironment"
	EnvironmentPanic           EnvironmentName = "PanicEnvironment"
	EnvironmentRocket          EnvironmentName = "RocketEnvironment"
	EnvironmentTimbaland       EnvironmentName = "TimbalandEnvironment"
	EnvironmentTriangle        EnvironmentName = "TriangleEnvironment"
)

type Event

type Event struct {
	Time  Time       `json:"_time"`
	Type  EventType  `json:"_type"`
	Value EventValue `json:"_value"`

	CustomData json.RawMessage `json:"_customData,omitempty"`

	Extra map[string]*json.RawMessage `json:"-"`
}

func (Event) MarshalJSON

func (e Event) MarshalJSON() ([]byte, error)

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(raw []byte) error

type EventType

type EventType int
const (
	EventTypeInvalid                          EventType = -1
	EventTypeBackLasers                       EventType = 0
	EventTypeRingLights                       EventType = 1
	EventTypeLeftRotatingLasers               EventType = 2
	EventTypeRightRotatingLasers              EventType = 3
	EventTypeCenterLights                     EventType = 4
	EventTypeBoostLights                      EventType = 5
	EventTypeInterscopeLeftLights             EventType = 6
	EventTypeInterscopeRightLights            EventType = 7
	EventTypeRingSpin                         EventType = 8
	EventTypeRingZoom                         EventType = 9
	EventTypeBPMChange                        EventType = 10
	EventTypeUnused11                         EventType = 11
	EventTypeLeftRotatingLasersRotationSpeed  EventType = 12
	EventTypeRightRotatingLasersRotationSpeed EventType = 13
	EventTypeEarlyRotation                    EventType = 14
	EventTypeLateRotation                     EventType = 15
	EventTypeInterscopeLowerHydraulics        EventType = 16
	EventTypeInterscopeRaiseHydraulics        EventType = 17
)

func (EventType) EventType

func (t EventType) EventType() EventType

type EventTypeSet

type EventTypeSet []EventType

func NewEventTypeSet

func NewEventTypeSet(eventTypes ...EventType) EventTypeSet

func (*EventTypeSet) Add

func (s *EventTypeSet) Add(eventTypes ...EventType)

func (EventTypeSet) Has

func (s EventTypeSet) Has(et EventType) bool

func (EventTypeSet) Pick

func (s EventTypeSet) Pick(n int) EventType

func (EventTypeSet) Union

func (s EventTypeSet) Union(sets ...EventTypeSet) EventTypeSet

type EventTyper

type EventTyper interface {
	EventType() EventType
}

type EventValue

type EventValue float64
const (
	EventValueInvalid        EventValue = -1
	EventValueLightOff       EventValue = 0
	EventValueLightBlueOn    EventValue = 1
	EventValueLightBlueFlash EventValue = 2
	EventValueLightBlueFade  EventValue = 3
	EventValueLightUnused4   EventValue = 4
	EventValueLightRedOn     EventValue = 5
	EventValueLightRedFlash  EventValue = 6
	EventValueLightRedFade   EventValue = 7
)

type EventValueSet

type EventValueSet []EventValue

func NewEventValueSet

func NewEventValueSet(eventValues ...EventValue) EventValueSet

func (EventValueSet) Pick

func (s EventValueSet) Pick(n int) EventValue

type Info

type Info struct {
	BPM float64 `json:"_beatsPerMinute"`

	BeatmapSets     []BeatmapSet    `json:"_difficultyBeatmapSets"`
	EnvironmentName EnvironmentName `json:"_environmentName"`

	Extra map[string]*json.RawMessage `json:"-"`
}

func (Info) MarshalJSON

func (in Info) MarshalJSON() ([]byte, error)

func (*Info) UnmarshalJSON

func (in *Info) UnmarshalJSON(raw []byte) error

type Map

type Map struct {
	Info *Info
	// contains filtered or unexported fields
}

func Open

func Open(dir string) (*Map, error)

func (*Map) ActiveDifficulty

func (m *Map) ActiveDifficulty() *Difficulty

func (*Map) ActiveDifficultyProfile

func (m *Map) ActiveDifficultyProfile() *EnvProfile

func (*Map) AppendEvents

func (m *Map) AppendEvents(events []Event) error

func (*Map) Events

func (m *Map) Events() []Event

func (*Map) SaveEvents

func (m *Map) SaveEvents(events []Event) error

func (*Map) SetActiveDifficulty

func (m *Map) SetActiveDifficulty(characteristic Characteristic, difficulty BeatmapDifficulty) error

func (*Map) UnscaleTime

func (m *Map) UnscaleTime(beat float64) Time

type MockMap

type MockMap struct {
	// contains filtered or unexported fields
}

func NewMockMap

func NewMockMap(envName EnvironmentName, bpm float64, bpmRegionsJSON string) (MockMap, error)

func (MockMap) ActiveDifficulty

func (m MockMap) ActiveDifficulty() *Difficulty

func (MockMap) ActiveDifficultyProfile

func (m MockMap) ActiveDifficultyProfile() *EnvProfile

func (MockMap) AppendEvents

func (MockMap) AppendEvents(events []Event) error

func (MockMap) Events

func (MockMap) Events() []Event

func (MockMap) SaveEvents

func (MockMap) SaveEvents(events []Event) error

func (MockMap) SetActiveDifficulty

func (m MockMap) SetActiveDifficulty(c Characteristic, d BeatmapDifficulty) error

func (MockMap) UnscaleTime

func (m MockMap) UnscaleTime(beat float64) Time

type Note

type Note struct {
	Time         Time         `json:"_time"`
	LineIndex    int          `json:"_lineIndex"`
	LineLayer    int          `json:"_lineLayer"`
	Type         NoteType     `json:"_type"`
	CutDirection CutDirection `json:"_cutDirection"`

	Extra map[string]*json.RawMessage `json:"-"`
}

type NoteType

type NoteType int

type Time

type Time float64

Jump to

Keyboard shortcuts

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