mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-04-21 15:00:18 +00:00
feat(calc): calculate_score_range(chart, pure, far)
This commit is contained in:
parent
a03edf47dd
commit
6ec8e7e4f8
@ -5,6 +5,15 @@ from typing import Dict, List
|
|||||||
from .models import Calculated, Chart, Score
|
from .models import Calculated, Chart, Score
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_score_range(chart: Chart, pure: int, far: int):
|
||||||
|
single_note_score = 10000000 / Decimal(chart.note)
|
||||||
|
|
||||||
|
actual_score = floor(
|
||||||
|
single_note_score * pure + single_note_score * Decimal(0.5) * far
|
||||||
|
)
|
||||||
|
return (actual_score, actual_score + pure)
|
||||||
|
|
||||||
|
|
||||||
def calculate_score(chart: Chart, score: Score) -> Calculated:
|
def calculate_score(chart: Chart, score: Score) -> Calculated:
|
||||||
assert chart.song_id == score.song_id
|
assert chart.song_id == score.song_id
|
||||||
assert chart.rating_class == score.rating_class
|
assert chart.rating_class == score.rating_class
|
||||||
|
Loading…
x
Reference in New Issue
Block a user