migrate some values to ssr data tracking so we don't need to rely on BL as much
This commit is contained in:
@ -3,6 +3,7 @@ import Score from "../score";
|
||||
import { type ScoreSaberLeaderboardPlayerInfoToken } from "../../../types/token/scoresaber/score-saber-leaderboard-player-info-token";
|
||||
import { Document } from "mongoose";
|
||||
import { AutoIncrementID } from "@typegoose/auto-increment";
|
||||
import { PreviousScore } from "../previous-score";
|
||||
|
||||
@modelOptions({
|
||||
options: { allowMixed: Severity.ALLOW },
|
||||
@ -58,6 +59,11 @@ export class ScoreSaberScoreInternal extends Score {
|
||||
*/
|
||||
@Prop({ required: true })
|
||||
public readonly maxCombo!: number;
|
||||
|
||||
/**
|
||||
* The previous score, if any.
|
||||
*/
|
||||
public previousScore?: ScoreSaberPreviousScore;
|
||||
}
|
||||
|
||||
class ScoreSaberScorePublic extends ScoreSaberScoreInternal {
|
||||
@ -67,6 +73,28 @@ class ScoreSaberScorePublic extends ScoreSaberScoreInternal {
|
||||
public playerInfo!: ScoreSaberLeaderboardPlayerInfoToken;
|
||||
}
|
||||
|
||||
export type ScoreSaberPreviousScore = PreviousScore & {
|
||||
/**
|
||||
* The pp of the previous score.
|
||||
*/
|
||||
pp: number;
|
||||
|
||||
/**
|
||||
* The weight of the previous score.
|
||||
*/
|
||||
weight: number;
|
||||
|
||||
/**
|
||||
* The max combo of the previous score.
|
||||
*/
|
||||
maxCombo: number;
|
||||
|
||||
/**
|
||||
* The change between the previous score and the current score.
|
||||
*/
|
||||
change?: ScoreSaberPreviousScore;
|
||||
};
|
||||
|
||||
export type ScoreSaberScore = InstanceType<typeof ScoreSaberScorePublic>;
|
||||
export type ScoreSaberScoreDocument = ScoreSaberScore & Document;
|
||||
export const ScoreSaberScoreModel: ReturnModelType<typeof ScoreSaberScoreInternal> =
|
||||
|
38
projects/common/src/model/score/previous-score.ts
Normal file
38
projects/common/src/model/score/previous-score.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import { Modifier } from "../../score/modifier";
|
||||
|
||||
export type PreviousScore = {
|
||||
/**
|
||||
* The score of the previous score.
|
||||
*/
|
||||
score: number;
|
||||
|
||||
/**
|
||||
* The accuracy of the previous score.
|
||||
*/
|
||||
accuracy: number;
|
||||
|
||||
/**
|
||||
* The modifiers of the previous score.
|
||||
*/
|
||||
modifiers?: Modifier[];
|
||||
|
||||
/**
|
||||
* The misses of the previous score.
|
||||
*/
|
||||
misses: number;
|
||||
|
||||
/**
|
||||
* The missed notes of the previous score.
|
||||
*/
|
||||
missedNotes: number;
|
||||
|
||||
/**
|
||||
* The bad cuts of the previous score.
|
||||
*/
|
||||
badCuts: number;
|
||||
|
||||
/**
|
||||
* The full combo of the previous score.
|
||||
*/
|
||||
fullCombo?: boolean;
|
||||
};
|
Reference in New Issue
Block a user