model

package
v0.8.0-1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ARCHETYPE_BEAT      = "#BEAT"
	ARCHETYPE_BPM       = "#BPM"
	ARCHETYPE_BPMCHANGE = "#BPM_CHANGE"
	ARCHTYPE_TIMESCALE  = "#TIMESCALE"
	ARCHTYPE_JUDGMENT   = "#JUDGMENT"
	ARCHTYPE_ACCURACY   = "#ACCURACY"
)

from sonolus-core ref: https://github.com/Sonolus/sonolus-core/blob/master/src/common/core/engine/engine-archetype-data-name.ts

Variables

This section is empty.

Functions

func SlideLongConvertor

func SlideLongConvertor(ctx context.Context, connections []BestdoriConnectionNote) error

Types

type BaseBestdoriNote

type BaseBestdoriNote struct {
	BaseBestdoriObject
	Lane  float64 `json:"lane"`
	Flick bool    `json:"flick,omitempty"`
}

type BaseBestdoriObject

type BaseBestdoriObject struct {
	Beat float64 `json:"beat"`
}

type BestdoriBpmObject

type BestdoriBpmObject struct {
	BaseBestdoriObject
	Bpm float64 `json:"bpm"`
}

func (*BestdoriBpmObject) Convert

func (bdNote *BestdoriBpmObject) Convert(ctx context.Context) error

type BestdoriChart

type BestdoriChart []BestdoriObject

func (*BestdoriChart) ConvertToSonnolus

func (bdChart *BestdoriChart) ConvertToSonnolus() (levelData SonolusLevelData, err error)

func (BestdoriChart) MarshalJSON

func (chart BestdoriChart) MarshalJSON() ([]byte, error)

func (*BestdoriChart) UnmarshalJSON

func (chart *BestdoriChart) UnmarshalJSON(data []byte) error

type BestdoriConnectionNote

type BestdoriConnectionNote struct {
	BaseBestdoriNote
	Hidden bool `json:"hidden,omitempty"`
}

type BestdoriDirectioalNote

type BestdoriDirectioalNote struct {
	BaseBestdoriNote
	Direction string  `json:"direction"`
	Width     float64 `json:"width"`
}

func (*BestdoriDirectioalNote) Convert

func (bdNote *BestdoriDirectioalNote) Convert(ctx context.Context) error

type BestdoriLongNote

type BestdoriLongNote struct {
	Connections []BestdoriConnectionNote `json:"connections"`
}

func (*BestdoriLongNote) Convert

func (bdNote *BestdoriLongNote) Convert(ctx context.Context) error

type BestdoriNote

type BestdoriNote struct {
	BaseBestdoriNote
}

func (*BestdoriNote) Convert

func (bdNote *BestdoriNote) Convert(ctx context.Context) error

type BestdoriObject

type BestdoriObject interface {
	Convert(ctx context.Context) error
	// contains filtered or unexported methods
}

type BestdoriSlideNote

type BestdoriSlideNote struct {
	Connections []BestdoriConnectionNote `json:"connections"`
}

func (*BestdoriSlideNote) Convert

func (bdNote *BestdoriSlideNote) Convert(ctx context.Context) error

type DatabasePost

type DatabasePost struct {
	Id         int       `db:"id"`
	Title      string    `db:"title"`
	Difficulty int       `db:"difficulty"`
	Expired    time.Time `db:"expired"`
	Upload     time.Time `db:"upload"`
	Hidden     bool      `db:"hidden"`
	BgmHash    string    `db:"bgmHash"`
	DataHash   string    `db:"dataHash"`
}

type Intermediate

type Intermediate struct {
	Archetype string                 `json:"archetype"`
	Data      map[string]interface{} `json:"data"` // Can be float64 or Intermediate
	Sim       bool                   `json:"sim"`
}

type SonolusLevelData

type SonolusLevelData struct {
	BgmOffset float64                   `json:"bgmOffset"`
	Entities  []*SonolusLevelDataEntity `json:"entities"`
}

type SonolusLevelDataEntity

type SonolusLevelDataEntity struct {
	Archetype string                       `json:"archetype"`
	Data      []SonolusLevelDataEntityData `json:"data"`
	Name      string                       `json:"name,omitempty"`
}

type SonolusLevelDataEntityData

type SonolusLevelDataEntityData struct {
	Name  string   `json:"name"`
	Value *float64 `json:"value,omitempty"` // Can be float64 or string
	Ref   string   `json:"ref,omitempty"`
}

type UploadPost

type UploadPost struct {
	Title      string                `form:"title" binding:"required"`
	Bgm        *multipart.FileHeader `form:"bgm" binding:"required"`
	Chart      BestdoriChart
	ChartStr   string `form:"chart" binding:"required"`
	Difficulty int    `form:"difficulty"`
	Hidden     bool   `form:"hidden"`
	Lifetime   int64  `form:"lifetime"`
}

func (*UploadPost) ParseChart

func (post *UploadPost) ParseChart() error

Jump to

Keyboard shortcuts

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