mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +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';
|
||||
|
||||
Reference in new issue
Block a user