项目作者: Itsyuka

项目描述 :
Osu beatmap parser, difficulty and performance calculator
高级语言: JavaScript
项目地址: git://github.com/Itsyuka/osu-bpdpc.git
创建时间: 2018-01-07T11:41:24Z
项目社区:https://github.com/Itsyuka/osu-bpdpc

开源协议:MIT License

下载


Osu Beatmap Parser, Difficulty and Performance Calculator

A soon to be full fledged system to allow parsing of beatmaps in .osu (or JSON built in), difficulty and performance calculations.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js 8.3.0+

Installing

In your project add the dependency

  1. npm i osu-bpdpc

and require inside your javascript file

  1. const BPDPC = require('osu-bpdpc');

or for specific elements using selective require

  1. const {Beatmap} = require('osu-bpdpc');

Example

  1. const {Beatmap, Osu: {DifficultyCalculator, PerformanceCalculator}} = require('osu-bpdpc')
  2. const request = require('request-promise-native')
  3. request.get('https://osu.ppy.sh/osu/1262832').then(osu => {
  4. let beatmap = Beatmap.fromOsu(osu)
  5. let score = {
  6. maxcombo: 476,
  7. count50: 0,
  8. count100: 3,
  9. count300: 337,
  10. countMiss: 0,
  11. countKatu: 2,
  12. countGeki: 71,
  13. perfect: 1,
  14. mods: 88,
  15. pp: 725.814
  16. }
  17. let diffCalc = DifficultyCalculator.use(beatmap).setMods(score.mods).calculate()
  18. let perfCalc = PerformanceCalculator.use(diffCalc).calculate(score)
  19. console.log(perfCalc.totalPerformance)
  20. })

License

This project is licensed under the MIT License - see the LICENSE file for details