mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: change tier back to number
This commit is contained in:
1 parent
8089a5eaa6
commit
fcb848df5b
16 files changed
+80
-119
No files matched your search
@@ -1,15 +1,14 @@
|
||||
import { Vector3Tuple } from 'three';
|
||||
import { Tier } from '../protos';
|
||||
|
||||
export const equipmentPriceMatrix: Record<Tier, Vector3Tuple> = {
|
||||
[Tier.I]: [100, 200, 300],
|
||||
[Tier.II]: [200, 300, 400],
|
||||
[Tier.III]: [400, 500, 600],
|
||||
[Tier.IV]: [4000, 5000, 6000],
|
||||
[Tier.V]: [40_000, 50_000, 60_000],
|
||||
[Tier.VI]: [100_000, 120_000, 140_000],
|
||||
[Tier.VII]: [150_000, 170_000, 190_000],
|
||||
[Tier.VIII]: [200_000, 225_000, 250_000],
|
||||
[Tier.IX]: [250_000, 275_000, 300_000],
|
||||
[Tier.X]: [300_000, 350_000, 400_000],
|
||||
export const equipmentPriceMatrix: Record<number, Vector3Tuple> = {
|
||||
1: [100, 200, 300],
|
||||
2: [200, 300, 400],
|
||||
3: [400, 500, 600],
|
||||
4: [4000, 5000, 6000],
|
||||
5: [40_000, 50_000, 60_000],
|
||||
6: [100_000, 120_000, 140_000],
|
||||
7: [150_000, 170_000, 190_000],
|
||||
8: [200_000, 225_000, 250_000],
|
||||
9: [250_000, 275_000, 300_000],
|
||||
10: [300_000, 350_000, 400_000],
|
||||
};
|
||||
@@ -1,24 +1,24 @@
|
||||
import { RatingInfo, Region } from '@blitzkit/core';
|
||||
import { context } from '../blitzkit/context';
|
||||
import { patientFetch } from '../blitzkit/patientFetch';
|
||||
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
|
||||
// import { Region } from '@blitzkit/core';
|
||||
// import { context } from '../blitzkit/context';
|
||||
// import { patientFetch } from '../blitzkit/patientFetch';
|
||||
// import { regionToRegionSubdomain } from './regionToRegionSubdomain';
|
||||
|
||||
const cache: Partial<Record<Region, RatingInfo>> = {};
|
||||
// const cache: Partial<Record<Region, RatingInfo>> = {};
|
||||
|
||||
export async function getRatingInfo(region: Region) {
|
||||
if (cache[region]) return cache[region]!;
|
||||
// export async function getRatingInfo(region: Region) {
|
||||
// if (cache[region]) return cache[region]!;
|
||||
|
||||
const response = await patientFetch(
|
||||
context === 'website'
|
||||
? `/api/${region}/rating/current/info`
|
||||
: `https://${regionToRegionSubdomain(
|
||||
region,
|
||||
)}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
||||
undefined,
|
||||
);
|
||||
const data = (await response.json()) as RatingInfo;
|
||||
// const response = await patientFetch(
|
||||
// context === 'website'
|
||||
// ? `/api/${region}/rating/current/info`
|
||||
// : `https://${regionToRegionSubdomain(
|
||||
// region,
|
||||
// )}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
||||
// undefined,
|
||||
// );
|
||||
// const data = (await response.json()) as RatingInfo;
|
||||
|
||||
cache[region] = data;
|
||||
// cache[region] = data;
|
||||
|
||||
return data;
|
||||
}
|
||||
// return data;
|
||||
// }
|
||||
@@ -9,7 +9,7 @@ export * from './getAccountInfo';
|
||||
export * from './getClanAccountInfo';
|
||||
export * from './getClanInfo';
|
||||
export * from './getLeagueFromScore';
|
||||
export * from './getRatingInfo';
|
||||
// export * from './getRatingInfo';
|
||||
export * from './getRatingLeague';
|
||||
export * from './getRatingNeighbors';
|
||||
export * from './getTankStats';
|
||||
|
||||
@@ -16,7 +16,7 @@ export * from './eventManager';
|
||||
// export * from './flagUserActivity';
|
||||
export * from './gameDefinitions';
|
||||
export * from './getArchivedLatestSeasonNumber';
|
||||
export * from './getArchivedRatingInfo';
|
||||
// export * from './getArchivedRatingInfo';
|
||||
export * from './getArchivedRatingLeaderboard';
|
||||
export * from './getArchivedRatingMidnightLeaderboard';
|
||||
export * from './getTimeDaysAgo';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { times } from 'lodash';
|
||||
import {
|
||||
CrewType,
|
||||
GunDefinition,
|
||||
ShellType,
|
||||
TankClass,
|
||||
TankType,
|
||||
Tier,
|
||||
} from '../../protos';
|
||||
|
||||
export const SHELL_NAMES: Record<ShellType, string> = {
|
||||
@@ -55,29 +55,18 @@ export const TANK_ICONS_COLLECTOR: Record<TankClass, string> = {
|
||||
[TankClass.MEDIUM]: 'https://i.imgur.com/u8YDMBh.png',
|
||||
[TankClass.HEAVY]: 'https://i.imgur.com/8xRf3nc.png',
|
||||
};
|
||||
export const TIERS = [
|
||||
Tier.I,
|
||||
Tier.II,
|
||||
Tier.III,
|
||||
Tier.IV,
|
||||
Tier.V,
|
||||
Tier.VI,
|
||||
Tier.VII,
|
||||
Tier.VIII,
|
||||
Tier.IX,
|
||||
Tier.X,
|
||||
];
|
||||
export const TIER_ROMAN_NUMERALS: Record<Tier, string> = {
|
||||
[Tier.I]: 'I',
|
||||
[Tier.II]: 'II',
|
||||
[Tier.III]: 'III',
|
||||
[Tier.IV]: 'IV',
|
||||
[Tier.V]: 'V',
|
||||
[Tier.VI]: 'VI',
|
||||
[Tier.VII]: 'VII',
|
||||
[Tier.VIII]: 'VIII',
|
||||
[Tier.IX]: 'IX',
|
||||
[Tier.X]: 'X',
|
||||
export const TIERS = times(10, (index) => index + 1);
|
||||
export const TIER_ROMAN_NUMERALS: Record<number, string> = {
|
||||
1: 'I',
|
||||
2: 'II',
|
||||
3: 'III',
|
||||
4: 'IV',
|
||||
5: 'V',
|
||||
6: 'VI',
|
||||
7: 'VII',
|
||||
8: 'VIII',
|
||||
9: 'IX',
|
||||
10: 'X',
|
||||
};
|
||||
|
||||
export const flags: Record<string, string> = {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { fetchTankDefinitions } from '../blitzkit';
|
||||
import { Tier } from '../protos';
|
||||
import { BlitzStats } from './compositeStats/constants';
|
||||
|
||||
export async function getTierWeights(
|
||||
@@ -20,4 +19,4 @@ export async function getTierWeights(
|
||||
|
||||
return tierWeights;
|
||||
}
|
||||
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
||||
export type TierWeightsRecord = Partial<Record<number, number>>;
|
||||
Reference in new issue
Block a user