reality

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

README

Milthm Reality

Go module milthm.dev/reality/v2 for computing reality scores based on song records.

Features

  • Compute individual record ratings from song difficulty and player score.
  • Aggregate up to 20 top ratings into a single reality score.

Installation

go get milthm.dev/reality/v2

Usage

import (
    "fmt"
    "milthm.dev/reality/v2"
)

func main() {
    // Implement ScoreRecorder and ChartInformationRepository interfaces
    total, err := reality.CalculateReality(scores, repo)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    fmt.Println("Total reality:", total)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateReality

func CalculateReality(scores []ScoreRecord, chartRepo ChartInformationRepository) (float64, error)

CalculateReality is used for calculating reality from given scores list and charts information

func CalculateSingleEntryReality

func CalculateSingleEntryReality(score ScoreRecord, chartRepo ChartInformationRepository) (float64, error)

CalculateSingleEntryReality is used for calculating how much reality this record donated

Types

type ChartInformationRepository

type ChartInformationRepository interface {
	GetDifficulty(chartID string) (float64, error)
}

type ScoreRecord

type ScoreRecord interface {
	GetChartID() string
	GetScore() float64
}

Jump to

Keyboard shortcuts

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