Compare commits

..
170 Commits
Author SHA1 Message Date
tresabhi d75a51660e feat: default sln file 2025-04-14 17:26:59 -05:00
tresabhi ac1323a463 feat: some things 2025-04-08 16:25:35 -05:00
tresabhi 292f7aeac0 feat: some more discoveries 2025-04-06 22:49:47 -05:00
tresabhi 1ee232d104 feat: start work on dynamic armor 2025-04-06 10:44:26 -05:00
tresabhi 1d301bf2fb Merge branch 'main' into ue 2025-04-05 22:15:05 -05:00
tresabhi 2a8ca6d36f Merge branch 'main' into ue 2025-04-05 17:18:36 -05:00
tresabhi ed5d2e3ff4 feat: more maps 2025-04-02 16:00:18 -05:00
tresabhi b2684e3152 fix: name 2025-04-01 21:59:00 -05:00
tresabhi d078454711 fix: depot 2025-04-01 21:56:23 -05:00
tresabhi 6aae1c8ee0 go go crazy! 2025-04-01 21:49:16 -05:00
tresabhi a560a37a56 feat: deploy 2025-04-01 21:48:36 -05:00
tresabhi 41486f84d4 fix: full export 2025-04-01 21:22:36 -05:00
tresabhi 29b12c7c28 fix: build only 2025-04-01 21:17:57 -05:00
tresabhi 2a3583a474 fix: cancel 2025-04-01 21:12:39 -05:00
tresabhi eb5e2a935c feat: more more more! 2025-04-01 21:12:06 -05:00
tresabhi 75f6f133ca feat: new website builder 2025-04-01 21:09:08 -05:00
tresabhi f26711bad9 feat: protos 2025-04-01 21:04:38 -05:00
tresabhi a8dc3313cf feat: mirrors 2025-04-01 21:03:39 -05:00
tresabhi 8087752172 feat: mirros 2025-04-01 15:32:37 -05:00
tresabhi cb03a86cce feat: proper assembly 2025-03-29 21:15:55 -05:00
tresabhi 838ce7f35d feat: model api 2025-03-29 20:26:32 -05:00
tresabhi e6f9b07b20 feat: modules list and translations 2025-03-29 19:29:29 -05:00
tresabhi 8afc334aa7 Merge branch 'main' into ue 2025-03-29 18:13:37 -05:00
tresabhi c7017a7a15 feat: cards 2025-03-23 19:07:37 -05:00
tresabhi f1462162f4 fix: persistent cam angle 2025-03-23 18:21:11 -05:00
tresabhi da4c2ece32 feat: better starting angle 2025-03-23 17:51:56 -05:00
tresabhi 80325aa3b2 feat: more fluid 2025-03-23 17:50:26 -05:00
tresabhi 3b937a6f35 feat: outlines 2025-03-23 17:41:38 -05:00
tresabhi 7a8f88f224 feat: safer drag 2025-03-23 17:22:42 -05:00
tresabhi 5982fdde8c feat: dragger 2025-03-23 17:18:42 -05:00
tresabhi dcd7ce61f7 feat: some manual disecting 2025-03-22 20:24:00 -05:00
tresabhi 43021c4945 feat: dissect event 2025-03-22 20:10:05 -05:00
tresabhi 4b24cf313b Merge branch 'ue' of https://github.com/tresabhi/blitzkit into ue 2025-03-22 18:44:01 -05:00
tresabhi d785588cf9 feat: some updates 2025-03-22 18:43:59 -05:00
TrèsAbhi dd9b34ea34 Update Unpacker.cs 2025-03-21 20:00:00 -05:00
tresabhi 7605e1d6f2 feat: new tab 2025-03-21 19:30:37 -05:00
tresabhi 7f056500ca fix: enable 2025-03-21 18:57:13 -05:00
tresabhi 0c37550c05 feat: outlines 2025-03-21 18:55:24 -05:00
tresabhi 1d928e8b72 feat: enabled 2025-03-21 18:08:53 -05:00
tresabhi 9e2465a6e3 fix: double blobbing 2025-03-21 16:51:03 -05:00
tresabhi b061bfd267 feat: prettier pretty log 2025-03-21 16:41:53 -05:00
tresabhi a90e5e20ea feat: but binary size after path 2025-03-21 16:33:34 -05:00
tresabhi 5fcade3efa feat: fill 2025-03-21 16:23:27 -05:00
tresabhi f1bb5736c0 feat: 4 chars 2025-03-21 16:22:14 -05:00
tresabhi 9b45f21457 feat: all pretty log 2025-03-21 16:20:39 -05:00
tresabhi 62fb80dddc feat: all collisions 2025-03-21 16:15:56 -05:00
tresabhi ff0cac84e1 feat: chassis mangler 2025-03-21 15:49:58 -05:00
tresabhi cbd2c2a719 feat: more rendering 2025-03-20 22:07:37 -05:00
tresabhi 5b16e22750 feat: some armor rendering 2025-03-20 21:48:17 -05:00
tresabhi 3a32624823 feat: build only 2025-03-20 20:13:14 -05:00
tresabhi 46374a7a26 feat: some hero code 2025-03-20 12:33:36 -05:00
tresabhi b856268ee0 feat: the thing 2025-03-20 12:17:05 -05:00
tresabhi e60bbc03d2 feat: separate armors 2025-03-20 11:59:24 -05:00
tresabhi 30b18f60be fix: optional static paths 2025-03-20 01:00:20 -05:00
tresabhi 754dff72b9 feat: smaller padding 2025-03-20 00:55:36 -05:00
tresabhi ef7655ab5d fix: color types 2025-03-20 00:53:47 -05:00
tresabhi 9491e7651a fix: types 2025-03-20 00:50:24 -05:00
tresabhi cccd96a021 feat: max file count 2025-03-20 00:21:27 -05:00
tresabhi 16a54ea291 feat: max file count 2025-03-20 00:20:05 -05:00
tresabhi f5c00643e4 feat: armors 2025-03-20 00:18:00 -05:00
tresabhi 652f36ba6c feat: hull model 2025-03-19 20:08:28 -05:00
tresabhi e1957daa5c feat: meta 2025-03-19 19:53:03 -05:00
tresabhi 222fda0c91 fix: i just realized the gallery is going bye bye 2025-03-19 19:48:26 -05:00
tresabhi c9467d68ae feat: in house icons 2025-03-19 19:36:05 -05:00
tresabhi d64f04b2c8 feat: icons 2025-03-19 19:27:47 -05:00
tresabhi a98f0e84d5 feat: gradient 2025-03-19 18:53:48 -05:00
tresabhi 6319e438b1 feat: make it compile! 2025-03-19 01:01:19 -05:00
tresabhi 90a64d4ccf fix: typo 2025-03-19 00:56:41 -05:00
tresabhi cb339eab5f more desc 2025-03-19 00:50:08 -05:00
tresabhi e6a92e2114 softer buttons 2025-03-19 00:49:23 -05:00
tresabhi 4bfc89302f feat: test button 2025-03-19 00:48:35 -05:00
tresabhi 6611088ccb feat: slugs 2025-03-19 00:24:25 -05:00
tresabhi 8d4933dd60 feat: some more apis 2025-03-18 23:53:52 -05:00
tresabhi 4b5ee9db09 feat: api docs 2025-03-18 23:04:08 -05:00
tresabhi cc3aa976db feat: comments 2025-03-18 18:32:14 -05:00
tresabhi 9fb4607bba Merge branch 'main' into ue 2025-03-18 17:41:22 -05:00
tresabhi 6f8790d148 gotta play it safe 2025-03-18 17:35:56 -05:00
tresabhi 57d63ea1d7 gotta go fast 2025-03-18 17:26:09 -05:00
tresabhi 35894f39cf feat: name fetching 2025-03-06 23:05:18 -06:00
tresabhi 18d762c41b fix: format 2025-03-06 21:55:42 -06:00
tresabhi 6ca74e2b83 feat: include change size 2025-03-06 21:55:27 -06:00
tresabhi 56ca3e5ed4 feat: background gray messages 2025-03-06 21:54:20 -06:00
tresabhi 2c059cdc59 feat: blue for no changes 2025-03-06 21:52:00 -06:00
tresabhi b0d7a49b16 feat: missing icon handling 2025-03-06 21:49:17 -06:00
tresabhi 9dfa5a7693 feat: smart uploader 2025-03-06 21:46:05 -06:00
tresabhi e79ed0cf85 feat: texture exporter 2025-03-06 19:41:55 -06:00
tresabhi f52460e98b feat: collision rendering 2025-03-05 12:15:52 -06:00
tresabhi 6a91e86b07 feat: handle duplicates 2025-03-05 11:52:39 -06:00
tresabhi 1fce9c1c88 fix: include all tanks 2025-03-05 10:03:03 -06:00
tresabhi 6e8fdcfeef fix: parrellel safe changes 2025-03-05 09:56:49 -06:00
tresabhi 2fffd512ac feat: include slugs in both 2025-03-05 09:52:09 -06:00
tresabhi 16b3a59f88 feat: slugs back in tanks 2025-03-05 09:51:02 -06:00
tresabhi ba36c600c4 feat: show ms 2025-03-05 00:12:10 -06:00
tresabhi 9fbdaaf87f feat: enable commiting 2025-03-05 00:10:00 -06:00
tresabhi 553c9d552b feat: human ids 2025-03-05 00:07:25 -06:00
tresabhi 1b017aad48 feat: seo ids list 2025-03-04 23:02:26 -06:00
tresabhi 74fefe6291 feat: let the damn thing compile 2025-03-04 22:55:45 -06:00
tresabhi 5d81b7ff5a Merge branch 'main' into ue 2025-03-04 22:45:27 -06:00
tresabhi 789578f2b3 incomplete stuff 2025-03-03 16:07:39 -06:00
tresabhi 0864825513 feat: names 2025-03-01 23:08:22 -06:00
tresabhi 6f11fb4a70 fix: delete after 2025-03-01 21:54:23 -06:00
tresabhi 1567f8270c fix: use escape 2025-03-01 21:51:45 -06:00
tresabhi 0b5d019dc8 feat: delete right after 2025-03-01 21:46:48 -06:00
tresabhi 932a04a398 feat: pre bundled 2025-03-01 21:46:17 -06:00
tresabhi 05c0839936 feat: file list 2025-03-01 21:38:06 -06:00
tresabhi 95ae891212 fix: provider 2025-03-01 21:34:39 -06:00
tresabhi 3aea04b6cb fix: remove filelist 2025-02-25 18:29:42 -06:00
tresabhi 1d28768bb7 feat: ini 2025-02-25 18:28:08 -06:00
tresabhi 14d9794f57 feat: try only pak0 2025-02-25 18:15:40 -06:00
tresabhi 9cd38db684 feat: include protos 2025-02-25 18:09:22 -06:00
tresabhi 6a5af32f6c feat: unpacker full 2025-02-25 18:03:38 -06:00
tresabhi af0b430927 feat: some unpacking 2025-02-25 17:55:05 -06:00
tresabhi 8c7f851692 feat: commit 2025-02-25 17:23:25 -06:00
tresabhi 57a2daa5e4 feat: hull collision mesh 2025-02-25 15:36:34 -06:00
tresabhi 63d27aec64 feat: canon interface 2025-02-25 15:15:03 -06:00
tresabhi 90c5c16b00 feat: some texture mounting 2025-02-02 22:22:10 -06:00
tresabhi 4d94205547 feat: some material things 2025-02-02 21:55:17 -06:00
tresabhi 31ff50ffd8 feat: custom gltf 2025-02-02 13:39:37 -06:00
tresabhi 22e4553720 feat: export 2025-02-02 00:54:07 -06:00
tresabhi 8b268cb647 feat: hull mesh 2025-02-02 00:25:47 -06:00
tresabhi 168a955380 feat: use nuget package 2025-02-01 22:05:27 -06:00
tresabhi 37ec987a32 feat: use nuget package 2025-02-01 22:04:58 -06:00
tresabhi 37b5d1c6e8 feat: implement mappeduobject 2025-02-01 22:01:06 -06:00
tresabhi 09abbbadc9 feat: more mapping 2025-02-01 21:51:43 -06:00
tresabhi 8b0f95c53d feat: more shit 2025-02-01 21:21:12 -06:00
tresabhi 920ef6e5c4 feat: extract tank mangle logic 2025-01-30 12:54:37 -06:00
tresabhi 6829ff921d feat: mangle crew healths 2025-01-30 12:49:15 -06:00
tresabhi c6f4a13abc feat: some healths 2025-01-30 11:31:55 -06:00
tresabhi 67f312075a feat: more proto 2025-01-29 19:14:46 -06:00
tresabhi 5881b5b533 feat: parsing 2025-01-28 19:56:34 -06:00
tresabhi aa4da2ac4e feat: maps 2025-01-28 19:53:15 -06:00
tresabhi d6c1e8069d feat: parsing 2025-01-28 19:52:49 -06:00
tresabhi 74a8df6842 feat: rename cli 2025-01-28 12:59:59 -06:00
tresabhi 157fa0c1dd feat: protos 2025-01-28 12:55:02 -06:00
tresabhi 0139dd45c9 feat: dir api 2025-01-27 22:17:13 -06:00
tresabhi 9546bf5bb7 feat: oh my lord i did it 2025-01-27 17:25:40 -06:00
tresabhi 1714028e83 feat: start of tank proto 2025-01-26 21:51:35 -06:00
tresabhi d178c458df feat: remove stuff 2025-01-26 21:17:25 -06:00
tresabhi 415aebfd74 fix: use debug 2025-01-26 17:05:53 -06:00
tresabhi 68fd8fcfc5 feat: exergize globs 2025-01-26 17:03:49 -06:00
tresabhi 4c16af918d fix: override 2025-01-26 13:12:03 -06:00
tresabhi b16601704f feat: sort hd and non-hd 2025-01-26 13:11:40 -06:00
tresabhi 3a2aa135a1 feat: archive vfs 2025-01-26 12:39:23 -06:00
tresabhi 6a43773b55 fix: use oodle prefix 2025-01-26 12:36:38 -06:00
tresabhi fa5132aba5 fix: log 2025-01-26 12:35:03 -06:00
tresabhi c21a2bf58b fix: await 2025-01-26 12:28:53 -06:00
tresabhi 55ef1ecbd8 feat: oodle 2025-01-26 12:28:14 -06:00
tresabhi 3883eddd5d feat: memory 2025-01-26 12:11:40 -06:00
tresabhi 40dd752cb7 feat: stream 2025-01-25 23:59:10 -06:00
tresabhi 3c6ae546f6 feat: dlc 2025-01-25 23:51:18 -06:00
tresabhi 51fe0fe41f feat: default ini parser 2025-01-25 23:27:39 -06:00
tresabhi 1957d960aa feat: agonostic dll 2025-01-25 22:44:50 -06:00
tresabhi 7098395323 feat: some unpacker stuff 2025-01-25 22:17:41 -06:00
tresabhi 57287cea3a fix: uh lol hide that 2025-01-25 21:50:32 -06:00
tresabhi 9158f0bb79 fix: use custom dir 2025-01-25 21:48:33 -06:00
tresabhi 55e5298ba6 fix: use dotnet 9 2025-01-25 21:46:14 -06:00
tresabhi fcc34f7942 fix: cd 2025-01-25 21:45:08 -06:00
tresabhi b70d65f37b feat: more 2025-01-25 21:42:25 -06:00
tresabhi 693c3f42a6 fix: regex 2025-01-25 21:21:52 -06:00
tresabhi eab868db05 fix: no s in paks 2025-01-25 21:18:30 -06:00
tresabhi 5a9c463457 fix: indent 2025-01-25 21:16:15 -06:00
tresabhi 8119cdbb36 feat: regex 2025-01-25 21:15:03 -06:00
tresabhi 8ce7a205f1 fix: app flag 2025-01-25 21:09:43 -06:00
tresabhi e943a1af82 feat: test of cron 2025-01-25 21:07:56 -06:00
tresabhi e4cb8b3116 feat: read 2025-01-25 14:24:18 -06:00
tresabhi 4afc413d8b feat: vfs 2025-01-25 13:49:28 -06:00
tresabhi df93c986f9 feat: first proof of concept of reading 2025-01-25 13:20:55 -06:00
tresabhi 6f9336d067 featL include as submodule 2025-01-25 12:04:48 -06:00
tresabhi 82af101f9c feat: pathing 2025-01-23 21:43:54 -06:00
tresabhi 8e4f4c39bb feat: start on cli 2025-01-20 22:16:15 -06:00
371 changed files with 39365 additions and 11124 deletions

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.30.6",
"commands": [
"dotnet-csharpier"
],
"rollForward": false
}
}
}
+1
View File
@@ -0,0 +1 @@
/submodules/
+3
View File
@@ -0,0 +1,3 @@
{
"tabWidth": 2
}
-150
View File
@@ -1,150 +0,0 @@
name: Build Assets
on:
push:
branches: main
workflow_dispatch:
inputs:
cdn_branch:
type: string
required: false
default: main
description: What CDN branch to write to
zip_url:
type: string
required: false
description: ZIP URL to download instead of Steam client
zip_root:
type: string
required: false
description: Root dir of ZIP which houses the executable and Data dir
schedule:
- cron: '0 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.cdn_branch }}
cancel-in-progress: true
env:
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
PUBLIC_ASSET_BRANCH: ${{ github.event.inputs.cdn_branch || secrets.PUBLIC_ASSET_BRANCH }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: true
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
PUBLIC_PATREON_CLIENT_ID: ${{ secrets.PUBLIC_PATREON_CLIENT_ID }}
PUBLIC_PATREON_REDIRECT_URI: ${{ secrets.PUBLIC_PATREON_REDIRECT_URI }}
PATREON_CLIENT_SECRET: ${{ secrets.PATREON_CLIENT_SECRET }}
PUBLIC_NITROPAY_ID: ${{ secrets.PUBLIC_NITROPAY_ID }}
PUBLIC_DEBUG_MISSING_I18N: false
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
jobs:
download_client:
name: Download client
runs-on: ubuntu-latest
steps:
- name: (ZIP) Maximize build space
if: github.event.inputs.zip_url != ''
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: (Steam) Setup bun
uses: oven-sh/setup-bun@v1
if: github.event.inputs.zip_url == ''
- name: (Steam) Install dependencies
if: github.event.inputs.zip_url == ''
run: bun install
- name: (Steam) Setup DepotDownloader
if: github.event.inputs.zip_url == ''
run: bun run setup:depotdownloader
- name: (Steam) Download client
if: github.event.inputs.zip_url == ''
run: |
chmod +x ./temp/depotDownloader/DepotDownloader
./temp/depotDownloader/DepotDownloader -q -os windows -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
- name: (Steam) Apply patches
if: github.event.inputs.zip_url == ''
run: bun setup:patches --depot
- name: (ZIP) Download client
if: github.event.inputs.zip_url != ''
env:
ZIP_URL: ${{ github.event.inputs.zip_url }}
ZIP_ROOT: ${{ github.event.inputs.zip_root }}
run: |
wget -q -O client.zip $ZIP_URL
unzip -q client.zip -d client
rm client.zip
mkdir -p depots/444202/0
mv client/$ZIP_ROOT/* depots/444202/0
- name: Archive depots
uses: actions/upload-artifact@v4
with:
name: depots
path: depots
build_assets:
name: Build assets
runs-on: ubuntu-latest
needs: download_client
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Lint
run: bun run lint:website
- name: Download depots
uses: actions/download-artifact@v4
with:
name: depots
path: depots
- name: AppArmor hack
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Start server and build assets
run: |
bun dev:website --verbosepa &
SERVER_PID=$!
bun run build:assets --all-targets --depot --production
kill $SERVER_PID || true
+107 -9
View File
@@ -14,20 +14,29 @@ permissions:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
cancel-in-progress: true
env:
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
# PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: "true"
ALLOW_ROBOTS: true
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
DEPOT_DOWNLOADER_USERNAME: ${{ secrets.DEPOT_DOWNLOADER_USERNAME }}
DEPOT_DOWNLOADER_PASSWORD: ${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}
STEAM_OS: windows
STEAM_APP: 3341250
STEAM_DEPOT: 3341251
PUBLIC_ASSET_BRANCH: ue
GH_TOKEN: ${{ secrets.GH_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
jobs:
@@ -35,23 +44,80 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: actions/configure-pages@v5
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
- name: Configure pages
uses: actions/configure-pages@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0
- name: Download Steam Depot
run: |
mkdir -p temp
echo "Downloading..."
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/SteamRE/DepotDownloader/releases/latest | \
grep -i "linux-x64" | \
grep "browser_download_url" | \
cut -d '"' -f 4)
curl -L "$DOWNLOAD_URL" -o temp/depotDownloader.zip
echo "Unzipping..."
unzip temp/depotDownloader.zip -d temp/depotDownloader
echo "Download complete; files:"
ls temp/depotDownloader
- name: Download dependencies
run: bun install
- name: Build website
run: bun run build:website
- name: Restore dependencies
run: |
cd src/BlitzKit.CLI
dotnet restore
- name: Download client
run: |
chmod +x temp/depotDownloader/DepotDownloader
temp/depotDownloader/DepotDownloader \
-username "${{ env.DEPOT_DOWNLOADER_USERNAME }}" \
-password "${{ env.DEPOT_DOWNLOADER_PASSWORD }}" \
-os ${{ env.STEAM_OS }} \
-app ${{ env.STEAM_APP }} \
-depot ${{ env.STEAM_DEPOT }} \
-dir temp/depot \
-filelist filelist.txt
- name: Download containers
run: |
cd src/BlitzKit.CLI
dotnet run unpack ../../temp/depot
- name: Run API and build website
run: |
cd src/BlitzKit.CLI
dotnet run api --depot --verbosepa &
SERVER_PID=$!
cd ../..
bun run buildonly:website
kill $SERVER_PID || true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: build
path: dist/website
deploy-github-pages:
@@ -67,3 +133,35 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy-vercel:
if: ${{ github.ref != 'refs/heads/main' }}
name: Deploy to Vercel
runs-on: ubuntu-latest
needs: build
environment:
name: Preview
url: ${{ steps.url.outputs.url }}
steps:
- uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build
path: .vercel/output/
- name: Install Vercel CLI
run: bun install --global vercel
- name: Deploy Project Artifacts to Vercel
shell: bash
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tee deploy.log
- name: Set preview url
id: url
run: echo "url=$(tail -1 deploy.log)">> $GITHUB_OUTPUT
+490 -2
View File
@@ -1,3 +1,5 @@
# src/BlitzKit.CLI/Protos
node_modules
_node_modules
package-lock.json
@@ -27,5 +29,491 @@ target
/.vercel
/.astro
.vercel
/src
/packages/bot/src/prisma
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from `dotnet new gitignore`
# dotenv files
.env
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
# REMOVING THIS BECAUSE IT IGNORES PACKAGES LOL
# **/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
.idea/
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# Vim temporary swap files
*.swp
+1
View File
@@ -0,0 +1 @@
/submodules/
+17 -6
View File
@@ -12,6 +12,7 @@
"APAC",
"apcr",
"applypatches",
"arrayfy",
"artefacts",
"astrojs",
"astrolib",
@@ -36,7 +37,6 @@
"cacheable",
"Callouts",
"Camo",
"Carro",
"CCPAOPTOUT",
"CDON",
"classname",
@@ -44,7 +44,6 @@
"closedkrieg",
"cockroackdb",
"Coef",
"Combattimento",
"cooldown",
"corelations",
"corsproxy",
@@ -56,7 +55,6 @@
"dbid",
"Ddpf",
"Ddsd",
"deadrail",
"debugflags",
"deburr",
"decalmask",
@@ -75,6 +73,10 @@
"dxgi",
"echarts",
"Everytime",
"Exergizable",
"Exergize",
"Exergizing",
"Exergy",
"FASTNAME",
"flexdirection",
"FOURCC",
@@ -121,12 +123,14 @@
"NEGATIVEX",
"NEGATIVEY",
"NEGATIVEZ",
"Newtonsoft",
"NITROPAY",
"nivo",
"nmatname",
"noout",
"normalmap",
"oneof",
"Oodle",
"oopsies",
"Oopsy",
"opentest",
@@ -134,17 +138,19 @@
"outdir",
"outfile",
"ownedtanks",
"padder",
"paks",
"partytown",
"PIXELFORMAT",
"playerachievements",
"playerinfo",
"playform",
"Playtest",
"pngjs",
"POSITIVEX",
"POSITIVEY",
"POSITIVEZ",
"precompute",
"preforged",
"Promisable",
"proto",
"protobuf",
@@ -152,6 +158,7 @@
"Pyogenics",
"ratingleaderboard",
"raycaster",
"regen",
"researchable",
"Resvg",
"rizz",
@@ -188,9 +195,10 @@
"TEXCOORD",
"tresabhi",
"tungstentip",
"Turretless",
"TYPELESS",
"uasset",
"ubjson",
"uexp",
"Unicum",
"UNLOCALIZED",
"UNORM",
@@ -198,7 +206,9 @@
"Unregistering",
"unrotate",
"unwrapper",
"Usmap",
"vercel",
"Verts",
"vickers",
"vitepress",
"Vovko",
@@ -226,5 +236,6 @@
"deno.unstable": false,
"cSpell.enableFiletypes": ["glsl", "proto3"],
"typescript.tsdk": "node_modules\\typescript\\lib",
"liveServer.settings.multiRootWorkspaceName": "blitzkit"
"liveServer.settings.multiRootWorkspaceName": "blitzkit",
"dotnet.defaultSolution": "blitzkit.sln"
}
+41
View File
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/blitzkit.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/blitzkit.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/blitzkit.sln"
],
"problemMatcher": "$msCompile"
}
]
}
+29
View File
@@ -0,0 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlitzKit.CLI", "src\BlitzKit.CLI\BlitzKit.CLI.csproj", "{65351C93-2DB4-8401-3BE1-C253571187A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{65351C93-2DB4-8401-3BE1-C253571187A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65351C93-2DB4-8401-3BE1-C253571187A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65351C93-2DB4-8401-3BE1-C253571187A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65351C93-2DB4-8401-3BE1-C253571187A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{65351C93-2DB4-8401-3BE1-C253571187A1} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70DA613E-E0B8-4525-93DB-3BF91568E845}
EndGlobalSection
EndGlobal
BIN
View File
Binary file not shown.
-23
View File
@@ -1,23 +0,0 @@
# BlitzKit 1.27.10
This update changes the URLs across the whole website, removing the "tools" prefix and simplifying other aspects too.
## Changes
- Removed "full" tank names
- For example, tanks like the "Carro 45t" had full names like "Carro Combattimento 45t" which remained pretty much unused, so they have been removed
- Reduced the shadow below the navigation bar
- Removed the "tools" prefix from the URLs; here are the paths:
- `/tools/tankopedia` -> `/tanks`
- `/tools/tankopedia/12345` -> `/tanks/tank-name`
- `/tools/compare` -> `/compare`
- `/tools/embed` -> `/embed`
- `/tools/embed/embed-name` -> `/embed/embed-name`
- `/tools/gallery` -> `/gallery`
- `/tools/performance` -> `/performance`
- `/tools/session` -> `/session`
- `/tools/tier-list` -> `/tier-list`
## Technical Features
- The asset mangler now uses http headers and even more heuristics to minimize re-creating unchanged assets
-7
View File
@@ -1,7 +0,0 @@
# BlitzKit 1.27.11
This update affects both the bot and the website.
## Technical Changes
- Added a proper CDN domain to avoid error 429s and any slowdowns
-25
View File
@@ -1,25 +0,0 @@
# BlitzKit 1.27.7
![](https://i.imgur.com/qFepOaT.png)
This update only affects the website.
## Features
- Added a new foggy-wireframe transition between tabs to smooth out the jarring jumps
- Added animations pop-in and out animations on a few elements
- The tank name title now shrinks in size as soon as a disturbance is caused
- The shell selector, antagonist switcher, and thicknesses range now ease into frame
- The Tankopedia search page now loads as a skeleton by default before populating with tanks, allowing for the recently viewed tanks to load without cumulative shift
- Something similar was done to the Gallery tool
- Gave the meta section of the website some zest with nation-based backdrops
- The compare tabs in the Tankopedia are now centered
## Fixes
- The camera no longer snaps to the initial position when switching between tabs
## Technical Changes
- Backported some technologies from BlitzKit Reforged; you will not notice any differences in usage
- The popular tanks and gallery indexings have been moved to the asynchronous cron job
-12
View File
@@ -1,12 +0,0 @@
# BlitzKit 1.27.8
![](https://i.imgur.com/WO5MS94.png)
## Features
- The website now uses Inter as the font
- Added a cool new non-disturbed state for the Tankopedia because why not
## Changes
- Removed the Discord plug and language changer from the homepage
-27
View File
@@ -1,27 +0,0 @@
# BlitzKit 1.27.9
BlitzKit's great, but there's far too many numbers. This update adds a few visualizers to help new players understand how things relate numerically.
![](https://i.imgur.com/OV5ak4T.png)
## Features
- Added the turret and hull traverse speed visualizer
- Added the shell ricochet and normalization angles visualizer
- Added the view-range visualizer
- Added a search bar to the Tankopedia characteristics
- Bumped the decimal places for vehicle dimensions and volume
- Made tank ranks softer (the bars beneath the tank characteristics)
- Gave the navigation bar better distinction from the rest of the page
- Increased the number of characteristics rows to 3 on select devices
- Switched to a more contrasting classic style of components across the website (it's subtle, but beautiful)
## Changes
- Removed units
## Fixes
- Clarified a few confusing row labels in the Compare tool
- Made the Tankopedia hero section dynamically smaller on mobile phones to allow scrolling
- Tank ranks no longer reach 0 or go above the number of vehicles in the comparison
+15
View File
@@ -0,0 +1,15 @@
`Blitz/Config/DefaultGameplayTags.ini` seems to have an exhaustive list of all maps, tanks, sets, game modes, legendary camouflages, consumables, skills, quick commands, UI components, etc.
`Blitz/Config/DefaultGame.ini` seems to have all locales under the name of "Cultures"
`Blitz/Config/DefaultDlc.ini` contains DLC info; essentially extra `pak` containers
`Blitz/Content/TanksStuff/Common/DT_TankClasses.uasset` seems to have all tank classes
`C:\Users\coola\AppData\Local\Blitz\Saved\PersistentDownloadDir\http\dl-wotblitz-gc.wargaming.net\dlc\p14y73c7_p5e_b10gg3RS_big_play\ue_localizations\development\general` has all localization files
`Blitz/Config/DefaultBzBattleSettings.ini` contains all modules that can take damage when a tank takes fall damage
`Blitz/Config/DefaultLocalizationFetcher.ini` has a list of all locales
`Blitz/Content/TanksStuff/Dev/DT_DAVATanks.uasset` has all DAVA-UE tank mappings
+1
View File
@@ -0,0 +1 @@
Blitz/Content/Paks/pakchunk0-Windows.pak
+15 -12
View File
@@ -1,7 +1,7 @@
{
"name": "blitzkit",
"private": true,
"version": "1.27.11",
"version": "1.27.6",
"description": "🎉 Tools for everything World of Tanks Blitz",
"type": "module",
"types": "./types.d.ts",
@@ -13,6 +13,7 @@
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
"build:bot": "cd packages/scripts && bun run build:bot",
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
"buildonly:website": "bun build:prisma --no-hints && cd packages/website && bun run buildonly",
"build:prisma": "prisma generate",
"build:sitemap": "bun scripts/sitemap.ts",
"build:docs": "vitepress build docs",
@@ -21,7 +22,6 @@
"start:bot": "bun dist/bot/main.js",
"dev:docs": "vitepress dev docs",
"dev:website": "cd packages/website && bun run dev",
"dev:api": "bun --filter=@blitzkit/api run dev",
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
"start:website": "bun --filter=@blitzkit/website run start",
@@ -32,25 +32,28 @@
"update": "yarn upgrade --latest",
"tunnel": "cloudflared tunnel --url http://localhost:3000",
"discoverids": "scripts/discoverIds.ts",
"build:protos": "bun packages/scripts/src/protos.ts",
"protos": "rm -rf src/BlitzKit.CLI/Protos && mkdir -p src/BlitzKit.CLI/Protos && protoc packages/core/src/protos/*.proto --csharp_out=src/BlitzKit.CLI/Protos && bun packages/scripts/src/protos.ts",
"preview:website": "cd packages/website && bun run preview",
"build:reviews": "cd packages/scripts && bun build:reviews",
"build:ids": "cd packages/scripts && bun build:ids",
"prunestrings": "cd packages/scripts && bun prunestrings"
"prunestrings": "cd packages/scripts && bun prunestrings",
"dev:cli:unpack": "cd src/BlitzKit.CLI && dotnet run unpack \"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest\" --no-overwrite",
"mangle": "cd src/BlitzKit.CLI && dotnet run mangle",
"mangle2": "cd src/BlitzKit.CLI && dotnet run mangle2",
"api": "cd src/BlitzKit.CLI && dotnet run api",
"dev:api": "cd src/BlitzKit.CLI && dotnet watch run api"
},
"license": "MIT",
"dependencies": {
"googleapis": "^144.0.0",
"lodash-es": "^4.17.21",
"quicklime": "^1.2.0",
"sharp": "^0.33.5"
"sharp": "^0.33.5",
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@types/bun": "latest",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.14.1",
"prettier": "^3.5.3",
"prisma": "^6.6.0",
"typescript": "^5.8.3"
"@types/node": "^22.5.4",
"prettier": "^3.3.3",
"prisma": "^6.0.0",
"typescript": "^5.5.4"
}
}
+2 -2
View File
@@ -107,8 +107,8 @@ export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
if (!tank) return '';
const name = `[${tank.name}](<https://blitzkit.app/tanks/${
tank.slug
const name = `[${tank.name}](<https://blitzkit.app/tools/tankopedia/${
tank.id
}>)`;
const next =
data.next_price === null
+5 -2
View File
@@ -1,8 +1,11 @@
import { getAccountInfo, getClanAccountInfo } from '@blitzkit/core';
import {
getAccountInfo,
getClanAccountInfo,
linkBlitzAndDiscord,
} from '@blitzkit/core';
import { teal } from '@radix-ui/colors';
import { Glow } from '../components/AllStatsOverview/components/HeroStat/components/Glow';
import { CommandWrapper } from '../components/CommandWrapper';
import { linkBlitzAndDiscord } from '../core/db/linkBlitzAndDiscord';
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
+1 -1
View File
@@ -78,7 +78,7 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
)
.map(
(tank) =>
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name))}](<https://blitzkit.app/tanks/${tank.slug}>)`,
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name))}](<https://blitzkit.app/tools/tankopedia/${tank.id}>)`,
);
const lines = [title, ...tankList];
@@ -1,6 +1,5 @@
import { idToRegion } from '@blitzkit/core';
import { flagUserActivity } from '../db/flagUserActivity';
import { usersDatabase } from '../db/users';
import { idToRegion, usersDatabase } from '@blitzkit/core';
import { flagUserActivity } from '@blitzkit/core/src/blitzkit/flagUserActivity';
export async function getBlitzFromDiscord(discordId: bigint) {
const unique = await usersDatabase.discordUser.findUnique({
+1 -1
View File
@@ -1,4 +1,4 @@
import { usersDatabase } from '../db/users';
import { usersDatabase } from '@blitzkit/core';
import { client } from '../discord/client';
const EXIT_EVENTS = [
+1 -1
View File
@@ -6,7 +6,7 @@
"dependencies": {
"@octokit/plugin-throttling": "^8.2.0",
"@octokit/rest": "^20.1.1",
"@prisma/client": "^6.6.0",
"@prisma/client": "^5.19.1",
"adm-zip": "^0.5.16",
"crc": "^4.3.2",
"dotenv": "^16.4.5",
-1
View File
@@ -4,7 +4,6 @@ export * from './classes';
export * from './constants';
export * from './equipmentPrice';
export * from './fetchBlitz';
export * from './fetchGlossary';
export * from './generateStats';
export * from './getAccountAchievements';
export * from './getAccountInfo';
+3 -8
View File
@@ -1,12 +1,7 @@
import { assertSecret } from './assertSecret';
const repo = assertSecret(import.meta.env.PUBLIC_ASSET_REPO);
const branch = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
const fastUser = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_USER);
const fastRepo = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_REPO);
export function asset(path: string) {
return branch === 'main'
? `https://${fastUser}.github.io/${fastRepo}/${path}`
: `https://raw.githubusercontent.com/${repo}/${branch}/${path}`;
return `https://raw.githubusercontent.com/${assertSecret(
import.meta.env.PUBLIC_ASSET_REPO,
)}/${assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}/${path}`;
}
@@ -1,4 +1,4 @@
import { usersDatabase } from './users';
import { usersDatabase } from '@blitzkit/core';
export async function flagUserActivity(blitzId: number) {
await usersDatabase.user.upsert({
-7
View File
@@ -1,7 +0,0 @@
import { fetchPB } from '../protobuf';
import { Gallery } from '../protos';
import { asset } from './asset';
export function fetchGallery() {
return fetchPB(asset('definitions/gallery.pb'), Gallery);
}
+7 -2
View File
@@ -13,6 +13,7 @@ export * from './discoveredIdDefinitions';
export * from './emblemURL';
export * from './equipmentDefinitions';
export * from './eventManager';
// export * from './flagUserActivity';
export * from './gameDefinitions';
export * from './getArchivedLatestSeasonNumber';
// export * from './getArchivedRatingInfo';
@@ -20,6 +21,7 @@ export * from './getArchivedRatingLeaderboard';
// export * from './getArchivedRatingMidnightLeaderboard';
export * from './getTimeDaysAgo';
export * from './isExplosive';
export * from './linkBlitzAndDiscord';
export * from './mapDefinitions';
export * from './modelDefinitions';
export * from './normalizeBoundingBox';
@@ -42,8 +44,11 @@ export * from './unwrapBlitzkitResponse';
export * from './votes';
// export * from './withCORSProxy';
export * from './createDefaultProvisions';
export * from './gallery';
export * from './metaSortTank';
export * from './popularTanks';
export * from './romanize';
export * from './tank';
export * from './tankArmor';
export * from './tankModel';
export * from './tanks';
export * from './tanksFull';
export * from './youtubers';
@@ -1,5 +1,5 @@
import { usersDatabase } from '@blitzkit/core';
import { flagUserActivity } from './flagUserActivity';
import { usersDatabase } from './users';
export async function linkBlitzAndDiscord(discordId: bigint, blitzId: number) {
await usersDatabase.discordUser.upsert({
@@ -1,7 +0,0 @@
import { fetchPB } from '../protobuf';
import { PopularTanks } from '../protos';
import { asset } from './asset';
export function fetchPopularTanks() {
return fetchPB(asset('definitions/popular-tanks.pb'), PopularTanks);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { Tank } from '../protos';
import { asset } from './asset';
export function fetchTank(id: string) {
return fetchPB(asset(`tanks/${id}/meta.pb`), Tank);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { TankArmor } from '../protos';
import { asset } from './asset';
export function fetchTankArmor(id: string) {
return fetchPB(asset(`tanks/${id}/armor.pb`), TankArmor);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { TankModel } from '../protos';
import { asset } from './asset';
export function fetchTankModel(id: string) {
return fetchPB(asset(`tanks/${id}/model.pb`), TankModel);
}
+4 -8
View File
@@ -15,22 +15,18 @@ export async function fetchTankNames() {
tankDefinitionsArray.map(async (tank) => {
const searchableNameDeburr: I18nString = { locales: {} };
Object.entries(tank.name).forEach(([key, value]) => {
Object.entries(tank.name_full ?? tank.name).forEach(([key, value]) => {
searchableNameDeburr.locales[key] = deburr(value);
});
return {
id: tank.id,
name: tank.name,
searchableName: tank.name,
nameFull: tank.name_full,
searchableName: tank.name_full ?? tank.name,
searchableNameDeburr,
camouflages: tank.camouflages
?.map((id) =>
SUPPORTED_LOCALES.map(
(locale) =>
camouflageDefinitions.camouflages[id]?.name.locales[locale],
),
)
?.map((id) => SUPPORTED_LOCALES.map((locale) => camouflageDefinitions.camouflages[id]?.name.locales[locale]))
.flat()
.filter(Boolean)
.map(deburr)
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { Tanks } from '../protos';
import { asset } from './asset';
export function fetchTanks() {
return fetchPB(asset('definitions/tanks.pb'), Tanks);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { TanksFull } from '../protos';
import { asset } from './asset';
export function fetchTanksFull() {
return fetchPB(asset('definitions/tanks-full.pb'), TanksFull);
}
+1
View File
@@ -0,0 +1 @@
export * from './users';
@@ -1,3 +1,3 @@
import { PrismaClient } from '../../prisma';
import { PrismaClient } from '@prisma/client';
export const usersDatabase = new PrismaClient();
+1
View File
@@ -1,5 +1,6 @@
export * from './blitz';
export * from './blitzkit';
export * from './databases';
export * from './imgur';
export * from './math';
export * from './patreon';
@@ -1,343 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/camouflage_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
export const protobufPackage = "blitzkit";
export interface CamouflageDefinitions {
camouflages: { [key: number]: Camouflage };
}
export interface CamouflageDefinitions_CamouflagesEntry {
key: number;
value: Camouflage | undefined;
}
export interface Camouflage {
id: number;
name: I18nString;
tank_name?: I18nString | undefined;
tank_name_full?: I18nString | undefined;
}
function createBaseCamouflageDefinitions(): CamouflageDefinitions {
return { camouflages: {} };
}
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.camouflages).forEach(([key, value]) => {
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.camouflages[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions {
return {
camouflages: isObject(object.camouflages)
? Object.entries(object.camouflages).reduce<{ [key: number]: Camouflage }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: CamouflageDefinitions): unknown {
const obj: any = {};
if (message.camouflages) {
const entries = Object.entries(message.camouflages);
if (entries.length > 0) {
obj.camouflages = {};
entries.forEach(([k, v]) => {
obj.camouflages[k] = Camouflage.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(base?: I): CamouflageDefinitions {
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
const message = createBaseCamouflageDefinitions();
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{ [key: number]: Camouflage }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
return { key: 0, value: createBaseCamouflage() };
}
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions_CamouflagesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Camouflage.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
return {
key: globalThis.Number(assertSet("CamouflageDefinitions_CamouflagesEntry.key", object.key)),
value: Camouflage.fromJSON(assertSet("CamouflageDefinitions_CamouflagesEntry.value", object.value)),
};
},
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Camouflage.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
base?: I,
): CamouflageDefinitions_CamouflagesEntry {
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
object: I,
): CamouflageDefinitions_CamouflagesEntry {
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Camouflage.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseCamouflage(): Camouflage {
return { id: 0, name: createBaseI18nString(), tank_name: undefined, tank_name_full: undefined };
}
export const Camouflage: MessageFns<Camouflage> = {
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.tank_name !== undefined) {
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
}
if (message.tank_name_full !== undefined) {
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.tank_name = I18nString.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.tank_name_full = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Camouflage {
return {
id: globalThis.Number(assertSet("Camouflage.id", object.id)),
name: I18nString.fromJSON(assertSet("Camouflage.name", object.name)),
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
};
},
toJSON(message: Camouflage): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.tank_name !== undefined) {
obj.tank_name = I18nString.toJSON(message.tank_name);
}
if (message.tank_name_full !== undefined) {
obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
}
return obj;
},
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
return Camouflage.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
const message = createBaseCamouflage();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
? I18nString.fromPartial(object.tank_name)
: undefined;
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
? I18nString.fromPartial(object.tank_name_full)
: undefined;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -1,883 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/consumable_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
export const protobufPackage = "blitzkit";
export enum ConsumableTankCategoryFilterCategory {
CLIP = 0,
}
export function consumableTankCategoryFilterCategoryFromJSON(object: any): ConsumableTankCategoryFilterCategory {
switch (object) {
case 0:
case "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP":
return ConsumableTankCategoryFilterCategory.CLIP;
default:
throw new globalThis.Error(
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
);
}
}
export function consumableTankCategoryFilterCategoryToJSON(object: ConsumableTankCategoryFilterCategory): string {
switch (object) {
case ConsumableTankCategoryFilterCategory.CLIP:
return "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP";
default:
throw new globalThis.Error(
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
);
}
}
export interface ConsumableDefinitions {
consumables: { [key: number]: Consumable };
}
export interface ConsumableDefinitions_ConsumablesEntry {
key: number;
value: Consumable | undefined;
}
export interface Consumable {
id: number;
name: I18nString;
cooldown: number;
duration?: number | undefined;
game_mode_exclusive: boolean;
include: ConsumableTankFilter[];
exclude: ConsumableTankFilter[];
}
export interface ConsumableTankFilter {
filter_type?:
| { $case: "tiers"; value: ConsumableTankTierFilter }
| { $case: "ids"; value: ConsumableTankIdsFilter }
| { $case: "categories"; value: ConsumableTankCategoryFilter }
| { $case: "nations"; value: ConsumableTankNationFilter }
| undefined;
}
export interface ConsumableTankTierFilter {
min: number;
max: number;
}
export interface ConsumableTankIdsFilter {
ids: number[];
}
export interface ConsumableTankCategoryFilter {
categories: ConsumableTankCategoryFilterCategory[];
}
export interface ConsumableTankNationFilter {
nations: string[];
}
function createBaseConsumableDefinitions(): ConsumableDefinitions {
return { consumables: {} };
}
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.consumables).forEach(([key, value]) => {
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = ConsumableDefinitions_ConsumablesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.consumables[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableDefinitions {
return {
consumables: isObject(object.consumables)
? Object.entries(object.consumables).reduce<{ [key: number]: Consumable }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: ConsumableDefinitions): unknown {
const obj: any = {};
if (message.consumables) {
const entries = Object.entries(message.consumables);
if (entries.length > 0) {
obj.consumables = {};
entries.forEach(([k, v]) => {
obj.consumables[k] = Consumable.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(base?: I): ConsumableDefinitions {
return ConsumableDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
const message = createBaseConsumableDefinitions();
message.consumables = Object.entries(object.consumables ?? {}).reduce<{ [key: number]: Consumable }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseConsumableDefinitions_ConsumablesEntry(): ConsumableDefinitions_ConsumablesEntry {
return { key: 0, value: createBaseConsumable() };
}
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> = {
encode(message: ConsumableDefinitions_ConsumablesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Consumable.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions_ConsumablesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableDefinitions_ConsumablesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Consumable.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
return {
key: globalThis.Number(assertSet("ConsumableDefinitions_ConsumablesEntry.key", object.key)),
value: Consumable.fromJSON(assertSet("ConsumableDefinitions_ConsumablesEntry.value", object.value)),
};
},
toJSON(message: ConsumableDefinitions_ConsumablesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Consumable.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
base?: I,
): ConsumableDefinitions_ConsumablesEntry {
return ConsumableDefinitions_ConsumablesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
object: I,
): ConsumableDefinitions_ConsumablesEntry {
const message = createBaseConsumableDefinitions_ConsumablesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Consumable.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseConsumable(): Consumable {
return {
id: 0,
name: createBaseI18nString(),
cooldown: 0,
duration: undefined,
game_mode_exclusive: false,
include: [],
exclude: [],
};
}
export const Consumable: MessageFns<Consumable> = {
encode(message: Consumable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.cooldown !== 0) {
writer.uint32(24).uint32(message.cooldown);
}
if (message.duration !== undefined && message.duration !== undefined) {
writer.uint32(37).float(message.duration);
}
if (message.game_mode_exclusive !== false) {
writer.uint32(40).bool(message.game_mode_exclusive);
}
for (const v of message.include) {
ConsumableTankFilter.encode(v!, writer.uint32(50).fork()).join();
}
for (const v of message.exclude) {
ConsumableTankFilter.encode(v!, writer.uint32(58).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumable();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.cooldown = reader.uint32();
continue;
}
case 4: {
if (tag !== 37) {
break;
}
message.duration = reader.float();
continue;
}
case 5: {
if (tag !== 40) {
break;
}
message.game_mode_exclusive = reader.bool();
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Consumable {
return {
id: globalThis.Number(assertSet("Consumable.id", object.id)),
name: I18nString.fromJSON(assertSet("Consumable.name", object.name)),
cooldown: globalThis.Number(assertSet("Consumable.cooldown", object.cooldown)),
duration: isSet(object.duration) ? globalThis.Number(object.duration) : undefined,
game_mode_exclusive: globalThis.Boolean(assertSet("Consumable.game_mode_exclusive", object.game_mode_exclusive)),
include: globalThis.Array.isArray(object?.include)
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
: [],
exclude: globalThis.Array.isArray(object?.exclude)
? object.exclude.map((e: any) => ConsumableTankFilter.fromJSON(e))
: [],
};
},
toJSON(message: Consumable): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.cooldown !== 0) {
obj.cooldown = Math.round(message.cooldown);
}
if (message.duration !== undefined && message.duration !== undefined) {
obj.duration = message.duration;
}
if (message.game_mode_exclusive !== false) {
obj.game_mode_exclusive = message.game_mode_exclusive;
}
if (message.include?.length) {
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
}
if (message.exclude?.length) {
obj.exclude = message.exclude.map((e) => ConsumableTankFilter.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<Consumable>, I>>(base?: I): Consumable {
return Consumable.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Consumable>, I>>(object: I): Consumable {
const message = createBaseConsumable();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.cooldown = object.cooldown ?? 0;
message.duration = object.duration ?? undefined;
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
return message;
},
};
function createBaseConsumableTankFilter(): ConsumableTankFilter {
return { filter_type: undefined };
}
export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
encode(message: ConsumableTankFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
switch (message.filter_type?.$case) {
case "tiers":
ConsumableTankTierFilter.encode(message.filter_type.value, writer.uint32(10).fork()).join();
break;
case "ids":
ConsumableTankIdsFilter.encode(message.filter_type.value, writer.uint32(18).fork()).join();
break;
case "categories":
ConsumableTankCategoryFilter.encode(message.filter_type.value, writer.uint32(26).fork()).join();
break;
case "nations":
ConsumableTankNationFilter.encode(message.filter_type.value, writer.uint32(34).fork()).join();
break;
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.decode(reader, reader.uint32()) };
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.decode(reader, reader.uint32()) };
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.filter_type = {
$case: "categories",
value: ConsumableTankCategoryFilter.decode(reader, reader.uint32()),
};
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.filter_type = { $case: "nations", value: ConsumableTankNationFilter.decode(reader, reader.uint32()) };
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankFilter {
return {
filter_type: isSet(object.tiers)
? { $case: "tiers", value: ConsumableTankTierFilter.fromJSON(object.tiers) }
: isSet(object.ids)
? { $case: "ids", value: ConsumableTankIdsFilter.fromJSON(object.ids) }
: isSet(object.categories)
? { $case: "categories", value: ConsumableTankCategoryFilter.fromJSON(object.categories) }
: isSet(object.nations)
? { $case: "nations", value: ConsumableTankNationFilter.fromJSON(object.nations) }
: undefined,
};
},
toJSON(message: ConsumableTankFilter): unknown {
const obj: any = {};
if (message.filter_type?.$case === "tiers") {
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
}
if (message.filter_type?.$case === "ids") {
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
}
if (message.filter_type?.$case === "categories") {
obj.categories = ConsumableTankCategoryFilter.toJSON(message.filter_type.value);
}
if (message.filter_type?.$case === "nations") {
obj.nations = ConsumableTankNationFilter.toJSON(message.filter_type.value);
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(base?: I): ConsumableTankFilter {
return ConsumableTankFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(object: I): ConsumableTankFilter {
const message = createBaseConsumableTankFilter();
if (
object.filter_type?.$case === "tiers" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.fromPartial(object.filter_type.value) };
}
if (
object.filter_type?.$case === "ids" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value) };
}
if (
object.filter_type?.$case === "categories" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = {
$case: "categories",
value: ConsumableTankCategoryFilter.fromPartial(object.filter_type.value),
};
}
if (
object.filter_type?.$case === "nations" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = {
$case: "nations",
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
};
}
return message;
},
};
function createBaseConsumableTankTierFilter(): ConsumableTankTierFilter {
return { min: 0, max: 0 };
}
export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
encode(message: ConsumableTankTierFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.min !== 0) {
writer.uint32(8).uint32(message.min);
}
if (message.max !== 0) {
writer.uint32(16).uint32(message.max);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankTierFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankTierFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.min = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.max = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankTierFilter {
return {
min: globalThis.Number(assertSet("ConsumableTankTierFilter.min", object.min)),
max: globalThis.Number(assertSet("ConsumableTankTierFilter.max", object.max)),
};
},
toJSON(message: ConsumableTankTierFilter): unknown {
const obj: any = {};
if (message.min !== 0) {
obj.min = Math.round(message.min);
}
if (message.max !== 0) {
obj.max = Math.round(message.max);
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(base?: I): ConsumableTankTierFilter {
return ConsumableTankTierFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(object: I): ConsumableTankTierFilter {
const message = createBaseConsumableTankTierFilter();
message.min = object.min ?? 0;
message.max = object.max ?? 0;
return message;
},
};
function createBaseConsumableTankIdsFilter(): ConsumableTankIdsFilter {
return { ids: [] };
}
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
encode(message: ConsumableTankIdsFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
writer.uint32(10).fork();
for (const v of message.ids) {
writer.uint32(v);
}
writer.join();
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankIdsFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankIdsFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag === 8) {
message.ids.push(reader.uint32());
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ids.push(reader.uint32());
}
continue;
}
break;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankIdsFilter {
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
},
toJSON(message: ConsumableTankIdsFilter): unknown {
const obj: any = {};
if (message.ids?.length) {
obj.ids = message.ids.map((e) => Math.round(e));
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(base?: I): ConsumableTankIdsFilter {
return ConsumableTankIdsFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(object: I): ConsumableTankIdsFilter {
const message = createBaseConsumableTankIdsFilter();
message.ids = object.ids?.map((e) => e) || [];
return message;
},
};
function createBaseConsumableTankCategoryFilter(): ConsumableTankCategoryFilter {
return { categories: [] };
}
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> = {
encode(message: ConsumableTankCategoryFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
writer.uint32(10).fork();
for (const v of message.categories) {
writer.int32(v);
}
writer.join();
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankCategoryFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankCategoryFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag === 8) {
message.categories.push(reader.int32() as any);
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.categories.push(reader.int32() as any);
}
continue;
}
break;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankCategoryFilter {
return {
categories: globalThis.Array.isArray(object?.categories)
? object.categories.map((e: any) => consumableTankCategoryFilterCategoryFromJSON(e))
: [],
};
},
toJSON(message: ConsumableTankCategoryFilter): unknown {
const obj: any = {};
if (message.categories?.length) {
obj.categories = message.categories.map((e) => consumableTankCategoryFilterCategoryToJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(base?: I): ConsumableTankCategoryFilter {
return ConsumableTankCategoryFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(object: I): ConsumableTankCategoryFilter {
const message = createBaseConsumableTankCategoryFilter();
message.categories = object.categories?.map((e) => e) || [];
return message;
},
};
function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
return { nations: [] };
}
export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter> = {
encode(message: ConsumableTankNationFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.nations) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankNationFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankNationFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.nations.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankNationFilter {
return {
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
};
},
toJSON(message: ConsumableTankNationFilter): unknown {
const obj: any = {};
if (message.nations?.length) {
obj.nations = message.nations;
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(base?: I): ConsumableTankNationFilter {
return ConsumableTankNationFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(object: I): ConsumableTankNationFilter {
const message = createBaseConsumableTankNationFilter();
message.nations = object.nations?.map((e) => e) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -1,578 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/equipment_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
export const protobufPackage = "blitzkit";
export interface EquipmentDefinitions {
presets: { [key: string]: EquipmentPreset };
equipments: { [key: number]: Equipment };
}
export interface EquipmentDefinitions_PresetsEntry {
key: string;
value: EquipmentPreset | undefined;
}
export interface EquipmentDefinitions_EquipmentsEntry {
key: number;
value: Equipment | undefined;
}
export interface Equipment {
name: I18nString;
description: I18nString;
}
export interface EquipmentPreset {
slots: EquipmentSlot[];
}
export interface EquipmentSlot {
left: number;
right: number;
}
function createBaseEquipmentDefinitions(): EquipmentDefinitions {
return { presets: {}, equipments: {} };
}
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.presets).forEach(([key, value]) => {
EquipmentDefinitions_PresetsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
Object.entries(message.equipments).forEach(([key, value]) => {
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = EquipmentDefinitions_PresetsEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.presets[entry1.key] = entry1.value;
}
continue;
}
case 2: {
if (tag !== 18) {
break;
}
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(reader, reader.uint32());
if (entry2.value !== undefined) {
message.equipments[entry2.key] = entry2.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions {
return {
presets: isObject(object.presets)
? Object.entries(object.presets).reduce<{ [key: string]: EquipmentPreset }>((acc, [key, value]) => {
acc[key] = EquipmentPreset.fromJSON(value);
return acc;
}, {})
: {},
equipments: isObject(object.equipments)
? Object.entries(object.equipments).reduce<{ [key: number]: Equipment }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: EquipmentDefinitions): unknown {
const obj: any = {};
if (message.presets) {
const entries = Object.entries(message.presets);
if (entries.length > 0) {
obj.presets = {};
entries.forEach(([k, v]) => {
obj.presets[k] = EquipmentPreset.toJSON(v);
});
}
}
if (message.equipments) {
const entries = Object.entries(message.equipments);
if (entries.length > 0) {
obj.equipments = {};
entries.forEach(([k, v]) => {
obj.equipments[k] = Equipment.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(base?: I): EquipmentDefinitions {
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
const message = createBaseEquipmentDefinitions();
message.presets = Object.entries(object.presets ?? {}).reduce<{ [key: string]: EquipmentPreset }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = EquipmentPreset.fromPartial(value);
}
return acc;
},
{},
);
message.equipments = Object.entries(object.equipments ?? {}).reduce<{ [key: number]: Equipment }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
return { key: "", value: createBaseEquipmentPreset() };
}
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_PresetsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_PresetsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = EquipmentPreset.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
return {
key: globalThis.String(assertSet("EquipmentDefinitions_PresetsEntry.key", object.key)),
value: EquipmentPreset.fromJSON(assertSet("EquipmentDefinitions_PresetsEntry.value", object.value)),
};
},
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = EquipmentPreset.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
base?: I,
): EquipmentDefinitions_PresetsEntry {
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
object: I,
): EquipmentDefinitions_PresetsEntry {
const message = createBaseEquipmentDefinitions_PresetsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? EquipmentPreset.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
return { key: 0, value: createBaseEquipment() };
}
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Equipment.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_EquipmentsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Equipment.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
return {
key: globalThis.Number(assertSet("EquipmentDefinitions_EquipmentsEntry.key", object.key)),
value: Equipment.fromJSON(assertSet("EquipmentDefinitions_EquipmentsEntry.value", object.value)),
};
},
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Equipment.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
base?: I,
): EquipmentDefinitions_EquipmentsEntry {
return EquipmentDefinitions_EquipmentsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
object: I,
): EquipmentDefinitions_EquipmentsEntry {
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Equipment.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipment(): Equipment {
return { name: createBaseI18nString(), description: createBaseI18nString() };
}
export const Equipment: MessageFns<Equipment> = {
encode(message: Equipment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join();
}
if (message.description !== undefined) {
I18nString.encode(message.description, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipment();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Equipment {
return {
name: I18nString.fromJSON(assertSet("Equipment.name", object.name)),
description: I18nString.fromJSON(assertSet("Equipment.description", object.description)),
};
},
toJSON(message: Equipment): unknown {
const obj: any = {};
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.description !== undefined) {
obj.description = I18nString.toJSON(message.description);
}
return obj;
},
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
return Equipment.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(object: I): Equipment {
const message = createBaseEquipment();
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.description = (object.description !== undefined && object.description !== null)
? I18nString.fromPartial(object.description)
: createBaseI18nString();
return message;
},
};
function createBaseEquipmentPreset(): EquipmentPreset {
return { slots: [] };
}
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
encode(message: EquipmentPreset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.slots) {
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentPreset();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.slots.push(EquipmentSlot.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentPreset {
return {
slots: globalThis.Array.isArray(object?.slots) ? object.slots.map((e: any) => EquipmentSlot.fromJSON(e)) : [],
};
},
toJSON(message: EquipmentPreset): unknown {
const obj: any = {};
if (message.slots?.length) {
obj.slots = message.slots.map((e) => EquipmentSlot.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(base?: I): EquipmentPreset {
return EquipmentPreset.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(object: I): EquipmentPreset {
const message = createBaseEquipmentPreset();
message.slots = object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
return message;
},
};
function createBaseEquipmentSlot(): EquipmentSlot {
return { left: 0, right: 0 };
}
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
encode(message: EquipmentSlot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.left !== 0) {
writer.uint32(8).uint32(message.left);
}
if (message.right !== 0) {
writer.uint32(16).uint32(message.right);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentSlot();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.left = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.right = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentSlot {
return {
left: globalThis.Number(assertSet("EquipmentSlot.left", object.left)),
right: globalThis.Number(assertSet("EquipmentSlot.right", object.right)),
};
},
toJSON(message: EquipmentSlot): unknown {
const obj: any = {};
if (message.left !== 0) {
obj.left = Math.round(message.left);
}
if (message.right !== 0) {
obj.right = Math.round(message.right);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(base?: I): EquipmentSlot {
return EquipmentSlot.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(object: I): EquipmentSlot {
const message = createBaseEquipmentSlot();
message.left = object.left ?? 0;
message.right = object.right ?? 0;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
-15
View File
@@ -1,15 +0,0 @@
syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
message Gallery {
repeated Avatar avatars = 1;
}
message Avatar {
required string id = 1;
required I18nString name = 2;
required string extension = 3;
}
-237
View File
@@ -1,237 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/gallery.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './i18n';
export const protobufPackage = 'blitzkit';
export interface Gallery {
avatars: Avatar[];
}
export interface Avatar {
id: string;
name: I18nString;
extension: string;
}
function createBaseGallery(): Gallery {
return { avatars: [] };
}
export const Gallery: MessageFns<Gallery> = {
encode(
message: Gallery,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
for (const v of message.avatars) {
Avatar.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Gallery {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGallery();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.avatars.push(Avatar.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Gallery {
return {
avatars: globalThis.Array.isArray(object?.avatars)
? object.avatars.map((e: any) => Avatar.fromJSON(e))
: [],
};
},
toJSON(message: Gallery): unknown {
const obj: any = {};
if (message.avatars?.length) {
obj.avatars = message.avatars.map((e) => Avatar.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<Gallery>, I>>(base?: I): Gallery {
return Gallery.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Gallery>, I>>(object: I): Gallery {
const message = createBaseGallery();
message.avatars = object.avatars?.map((e) => Avatar.fromPartial(e)) || [];
return message;
},
};
function createBaseAvatar(): Avatar {
return { id: '', name: createBaseI18nString(), extension: '' };
}
export const Avatar: MessageFns<Avatar> = {
encode(
message: Avatar,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== '') {
writer.uint32(10).string(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.extension !== '') {
writer.uint32(26).string(message.extension);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Avatar {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAvatar();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.extension = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Avatar {
return {
id: globalThis.String(assertSet('Avatar.id', object.id)),
name: I18nString.fromJSON(assertSet('Avatar.name', object.name)),
extension: globalThis.String(
assertSet('Avatar.extension', object.extension),
),
};
},
toJSON(message: Avatar): unknown {
const obj: any = {};
if (message.id !== '') {
obj.id = message.id;
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.extension !== '') {
obj.extension = message.extension;
}
return obj;
},
create<I extends Exact<DeepPartial<Avatar>, I>>(base?: I): Avatar {
return Avatar.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Avatar>, I>>(object: I): Avatar {
const message = createBaseAvatar();
message.id = object.id ?? '';
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.extension = object.extension ?? '';
return message;
},
};
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+18 -14
View File
@@ -1,16 +1,20 @@
// @ts-nocheck
export * from './average_definitions.ts';
export * from './camouflage_definitions.ts';
export * from './consumable_definitions.ts';
export * from './equipment_definitions.ts';
export * from './gallery.ts';
export * from './game_definitions.ts';
export * from './i18n.ts';
export * from './map_definitions.ts';
export * from './model_definitions.ts';
export * from './popular_tanks.ts';
export * from './provision_definitions.ts';
export * from './rating_leaderboard.ts';
export * from './legacy_average_definitions.ts';
export * from './legacy_camouflage_definitions.ts';
export * from './legacy_consumable_definitions.ts';
export * from './legacy_equipment_definitions.ts';
export * from './legacy_game_definitions.ts';
export * from './legacy_i18n.ts';
export * from './legacy_map_definitions.ts';
export * from './legacy_model_definitions.ts';
export * from './legacy_provision_definitions.ts';
export * from './legacy_rating_leaderboard.ts';
export * from './legacy_skill_definitions.ts';
export * from './legacy_tank_definitions.ts';
export * from './reviews.ts';
export * from './skill_definitions.ts';
export * from './tank_definitions.ts';
export * from './tank.ts';
export * from './tank_armor.ts';
export * from './tank_model.ts';
export * from './tanks.ts';
export * from './tanks_full.ts';
export * from './utils.ts';
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/average_definitions.proto
// source: packages/core/src/protos/legacy_average_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message CamouflageDefinitions {
map<uint32, Camouflage> camouflages = 1;
@@ -0,0 +1,415 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/legacy_camouflage_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = 'blitzkit';
export interface CamouflageDefinitions {
camouflages: { [key: number]: Camouflage };
}
export interface CamouflageDefinitions_CamouflagesEntry {
key: number;
value: Camouflage | undefined;
}
export interface Camouflage {
id: number;
name: I18nString;
tank_name?: I18nString | undefined;
tank_name_full?: I18nString | undefined;
}
function createBaseCamouflageDefinitions(): CamouflageDefinitions {
return { camouflages: {} };
}
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
encode(
message: CamouflageDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.camouflages).forEach(([key, value]) => {
CamouflageDefinitions_CamouflagesEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): CamouflageDefinitions {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.camouflages[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions {
return {
camouflages: isObject(object.camouflages)
? Object.entries(object.camouflages).reduce<{
[key: number]: Camouflage;
}>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: CamouflageDefinitions): unknown {
const obj: any = {};
if (message.camouflages) {
const entries = Object.entries(message.camouflages);
if (entries.length > 0) {
obj.camouflages = {};
entries.forEach(([k, v]) => {
obj.camouflages[k] = Camouflage.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
base?: I,
): CamouflageDefinitions {
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
object: I,
): CamouflageDefinitions {
const message = createBaseCamouflageDefinitions();
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{
[key: number]: Camouflage;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
return { key: 0, value: createBaseCamouflage() };
}
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> =
{
encode(
message: CamouflageDefinitions_CamouflagesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): CamouflageDefinitions_CamouflagesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Camouflage.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
return {
key: globalThis.Number(
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
),
value: Camouflage.fromJSON(
assertSet(
'CamouflageDefinitions_CamouflagesEntry.value',
object.value,
),
),
};
},
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Camouflage.toJSON(message.value);
}
return obj;
},
create<
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
base ?? ({} as any),
);
},
fromPartial<
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
>(object: I): CamouflageDefinitions_CamouflagesEntry {
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? Camouflage.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseCamouflage(): Camouflage {
return {
id: 0,
name: createBaseI18nString(),
tank_name: undefined,
tank_name_full: undefined,
};
}
export const Camouflage: MessageFns<Camouflage> = {
encode(
message: Camouflage,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.tank_name !== undefined) {
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
}
if (message.tank_name_full !== undefined) {
I18nString.encode(
message.tank_name_full,
writer.uint32(34).fork(),
).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.tank_name = I18nString.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.tank_name_full = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Camouflage {
return {
id: globalThis.Number(assertSet('Camouflage.id', object.id)),
name: I18nString.fromJSON(assertSet('Camouflage.name', object.name)),
tank_name: isSet(object.tank_name)
? I18nString.fromJSON(object.tank_name)
: undefined,
tank_name_full: isSet(object.tank_name_full)
? I18nString.fromJSON(object.tank_name_full)
: undefined,
};
},
toJSON(message: Camouflage): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.tank_name !== undefined) {
obj.tank_name = I18nString.toJSON(message.tank_name);
}
if (message.tank_name_full !== undefined) {
obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
}
return obj;
},
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
return Camouflage.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(
object: I,
): Camouflage {
const message = createBaseCamouflage();
message.id = object.id ?? 0;
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.tank_name =
object.tank_name !== undefined && object.tank_name !== null
? I18nString.fromPartial(object.tank_name)
: undefined;
message.tank_name_full =
object.tank_name_full !== undefined && object.tank_name_full !== null
? I18nString.fromPartial(object.tank_name_full)
: undefined;
return message;
},
};
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message ConsumableDefinitions {
map<uint32, Consumable> consumables = 1;
File diff suppressed because it is too large. Load diff
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message EquipmentDefinitions {
map<string, EquipmentPreset> presets = 1;
@@ -0,0 +1,675 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/legacy_equipment_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = 'blitzkit';
export interface EquipmentDefinitions {
presets: { [key: string]: EquipmentPreset };
equipments: { [key: number]: Equipment };
}
export interface EquipmentDefinitions_PresetsEntry {
key: string;
value: EquipmentPreset | undefined;
}
export interface EquipmentDefinitions_EquipmentsEntry {
key: number;
value: Equipment | undefined;
}
export interface Equipment {
name: I18nString;
description: I18nString;
}
export interface EquipmentPreset {
slots: EquipmentSlot[];
}
export interface EquipmentSlot {
left: number;
right: number;
}
function createBaseEquipmentDefinitions(): EquipmentDefinitions {
return { presets: {}, equipments: {} };
}
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
encode(
message: EquipmentDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.presets).forEach(([key, value]) => {
EquipmentDefinitions_PresetsEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
Object.entries(message.equipments).forEach(([key, value]) => {
EquipmentDefinitions_EquipmentsEntry.encode(
{ key: key as any, value },
writer.uint32(18).fork(),
).join();
});
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): EquipmentDefinitions {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = EquipmentDefinitions_PresetsEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.presets[entry1.key] = entry1.value;
}
continue;
}
case 2: {
if (tag !== 18) {
break;
}
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(
reader,
reader.uint32(),
);
if (entry2.value !== undefined) {
message.equipments[entry2.key] = entry2.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions {
return {
presets: isObject(object.presets)
? Object.entries(object.presets).reduce<{
[key: string]: EquipmentPreset;
}>((acc, [key, value]) => {
acc[key] = EquipmentPreset.fromJSON(value);
return acc;
}, {})
: {},
equipments: isObject(object.equipments)
? Object.entries(object.equipments).reduce<{
[key: number]: Equipment;
}>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: EquipmentDefinitions): unknown {
const obj: any = {};
if (message.presets) {
const entries = Object.entries(message.presets);
if (entries.length > 0) {
obj.presets = {};
entries.forEach(([k, v]) => {
obj.presets[k] = EquipmentPreset.toJSON(v);
});
}
}
if (message.equipments) {
const entries = Object.entries(message.equipments);
if (entries.length > 0) {
obj.equipments = {};
entries.forEach(([k, v]) => {
obj.equipments[k] = Equipment.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
base?: I,
): EquipmentDefinitions {
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
object: I,
): EquipmentDefinitions {
const message = createBaseEquipmentDefinitions();
message.presets = Object.entries(object.presets ?? {}).reduce<{
[key: string]: EquipmentPreset;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = EquipmentPreset.fromPartial(value);
}
return acc;
}, {});
message.equipments = Object.entries(object.equipments ?? {}).reduce<{
[key: number]: Equipment;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
return { key: '', value: createBaseEquipmentPreset() };
}
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> =
{
encode(
message: EquipmentDefinitions_PresetsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): EquipmentDefinitions_PresetsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_PresetsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = EquipmentPreset.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
return {
key: globalThis.String(
assertSet('EquipmentDefinitions_PresetsEntry.key', object.key),
),
value: EquipmentPreset.fromJSON(
assertSet('EquipmentDefinitions_PresetsEntry.value', object.value),
),
};
},
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = EquipmentPreset.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
base?: I,
): EquipmentDefinitions_PresetsEntry {
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<
I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>,
>(object: I): EquipmentDefinitions_PresetsEntry {
const message = createBaseEquipmentDefinitions_PresetsEntry();
message.key = object.key ?? '';
message.value =
object.value !== undefined && object.value !== null
? EquipmentPreset.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
return { key: 0, value: createBaseEquipment() };
}
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> =
{
encode(
message: EquipmentDefinitions_EquipmentsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Equipment.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): EquipmentDefinitions_EquipmentsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Equipment.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
return {
key: globalThis.Number(
assertSet('EquipmentDefinitions_EquipmentsEntry.key', object.key),
),
value: Equipment.fromJSON(
assertSet('EquipmentDefinitions_EquipmentsEntry.value', object.value),
),
};
},
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Equipment.toJSON(message.value);
}
return obj;
},
create<
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
>(base?: I): EquipmentDefinitions_EquipmentsEntry {
return EquipmentDefinitions_EquipmentsEntry.fromPartial(
base ?? ({} as any),
);
},
fromPartial<
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
>(object: I): EquipmentDefinitions_EquipmentsEntry {
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? Equipment.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipment(): Equipment {
return { name: createBaseI18nString(), description: createBaseI18nString() };
}
export const Equipment: MessageFns<Equipment> = {
encode(
message: Equipment,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join();
}
if (message.description !== undefined) {
I18nString.encode(message.description, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipment();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Equipment {
return {
name: I18nString.fromJSON(assertSet('Equipment.name', object.name)),
description: I18nString.fromJSON(
assertSet('Equipment.description', object.description),
),
};
},
toJSON(message: Equipment): unknown {
const obj: any = {};
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.description !== undefined) {
obj.description = I18nString.toJSON(message.description);
}
return obj;
},
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
return Equipment.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(
object: I,
): Equipment {
const message = createBaseEquipment();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.description =
object.description !== undefined && object.description !== null
? I18nString.fromPartial(object.description)
: createBaseI18nString();
return message;
},
};
function createBaseEquipmentPreset(): EquipmentPreset {
return { slots: [] };
}
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
encode(
message: EquipmentPreset,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
for (const v of message.slots) {
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentPreset();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.slots.push(EquipmentSlot.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentPreset {
return {
slots: globalThis.Array.isArray(object?.slots)
? object.slots.map((e: any) => EquipmentSlot.fromJSON(e))
: [],
};
},
toJSON(message: EquipmentPreset): unknown {
const obj: any = {};
if (message.slots?.length) {
obj.slots = message.slots.map((e) => EquipmentSlot.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
base?: I,
): EquipmentPreset {
return EquipmentPreset.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
object: I,
): EquipmentPreset {
const message = createBaseEquipmentPreset();
message.slots =
object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
return message;
},
};
function createBaseEquipmentSlot(): EquipmentSlot {
return { left: 0, right: 0 };
}
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
encode(
message: EquipmentSlot,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.left !== 0) {
writer.uint32(8).uint32(message.left);
}
if (message.right !== 0) {
writer.uint32(16).uint32(message.right);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentSlot();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.left = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.right = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentSlot {
return {
left: globalThis.Number(assertSet('EquipmentSlot.left', object.left)),
right: globalThis.Number(assertSet('EquipmentSlot.right', object.right)),
};
},
toJSON(message: EquipmentSlot): unknown {
const obj: any = {};
if (message.left !== 0) {
obj.left = Math.round(message.left);
}
if (message.right !== 0) {
obj.right = Math.round(message.right);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
base?: I,
): EquipmentSlot {
return EquipmentSlot.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
object: I,
): EquipmentSlot {
const message = createBaseEquipmentSlot();
message.left = object.left ?? 0;
message.right = object.right ?? 0;
return message;
},
};
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message GameDefinitions {
required string version = 1;
@@ -2,13 +2,13 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/game_definitions.proto
// source: packages/core/src/protos/legacy_game_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = "blitzkit";
export const protobufPackage = 'blitzkit';
export interface GameDefinitions {
version: string;
@@ -37,28 +37,38 @@ export interface GameModeRole {
}
function createBaseGameDefinitions(): GameDefinitions {
return { version: "", nations: [], gameModes: {}, roles: {} };
return { version: '', nations: [], gameModes: {}, roles: {} };
}
export const GameDefinitions: MessageFns<GameDefinitions> = {
encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.version !== "") {
encode(
message: GameDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.version !== '') {
writer.uint32(10).string(message.version);
}
for (const v of message.nations) {
writer.uint32(18).string(v!);
}
Object.entries(message.gameModes).forEach(([key, value]) => {
GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
GameDefinitions_GameModesEntry.encode(
{ key: key as any, value },
writer.uint32(26).fork(),
).join();
});
Object.entries(message.roles).forEach(([key, value]) => {
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
GameDefinitions_RolesEntry.encode(
{ key: key as any, value },
writer.uint32(34).fork(),
).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions();
while (reader.pos < end) {
@@ -85,7 +95,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
break;
}
const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32());
const entry3 = GameDefinitions_GameModesEntry.decode(
reader,
reader.uint32(),
);
if (entry3.value !== undefined) {
message.gameModes[entry3.key] = entry3.value;
}
@@ -96,7 +109,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
break;
}
const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32());
const entry4 = GameDefinitions_RolesEntry.decode(
reader,
reader.uint32(),
);
if (entry4.value !== undefined) {
message.roles[entry4.key] = entry4.value;
}
@@ -113,26 +129,36 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
fromJSON(object: any): GameDefinitions {
return {
version: globalThis.String(assertSet("GameDefinitions.version", object.version)),
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
version: globalThis.String(
assertSet('GameDefinitions.version', object.version),
),
nations: globalThis.Array.isArray(object?.nations)
? object.nations.map((e: any) => globalThis.String(e))
: [],
gameModes: isObject(object.gameModes)
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
return acc;
}, {})
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>(
(acc, [key, value]) => {
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
return acc;
},
{},
)
: {},
roles: isObject(object.roles)
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
return acc;
}, {})
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>(
(acc, [key, value]) => {
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
return acc;
},
{},
)
: {},
};
},
toJSON(message: GameDefinitions): unknown {
const obj: any = {};
if (message.version !== "") {
if (message.version !== '') {
obj.version = message.version;
}
if (message.nations?.length) {
@@ -159,23 +185,28 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
return obj;
},
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(base?: I): GameDefinitions {
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(
base?: I,
): GameDefinitions {
return GameDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(object: I): GameDefinitions {
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(
object: I,
): GameDefinitions {
const message = createBaseGameDefinitions();
message.version = object.version ?? "";
message.version = object.version ?? '';
message.nations = object.nations?.map((e) => e) || [];
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
}
return acc;
},
{},
);
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{
[key: number]: GameMode;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
}
return acc;
}, {});
message.roles = Object.entries(object.roles ?? {}).reduce<{
[key: number]: GameModeRole;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
}
@@ -189,166 +220,201 @@ function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEn
return { key: 0, value: createBaseGameMode() };
}
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
GameMode.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_GameModesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = GameMode.decode(reader, reader.uint32());
continue;
}
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> =
{
encode(
message: GameDefinitions_GameModesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if ((tag & 7) === 4 || tag === 0) {
break;
if (message.value !== undefined) {
GameMode.encode(message.value, writer.uint32(18).fork()).join();
}
reader.skip(tag & 7);
}
return message;
},
return writer;
},
fromJSON(object: any): GameDefinitions_GameModesEntry {
return {
key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)),
value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)),
};
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): GameDefinitions_GameModesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_GameModesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
toJSON(message: GameDefinitions_GameModesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameMode.toJSON(message.value);
}
return obj;
},
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(base?: I): GameDefinitions_GameModesEntry {
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
object: I,
): GameDefinitions_GameModesEntry {
const message = createBaseGameDefinitions_GameModesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? GameMode.fromPartial(object.value)
: undefined;
return message;
},
};
message.value = GameMode.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): GameDefinitions_GameModesEntry {
return {
key: globalThis.Number(
assertSet('GameDefinitions_GameModesEntry.key', object.key),
),
value: GameMode.fromJSON(
assertSet('GameDefinitions_GameModesEntry.value', object.value),
),
};
},
toJSON(message: GameDefinitions_GameModesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameMode.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
base?: I,
): GameDefinitions_GameModesEntry {
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<
I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>,
>(object: I): GameDefinitions_GameModesEntry {
const message = createBaseGameDefinitions_GameModesEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? GameMode.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
return { key: 0, value: createBaseGameModeRole() };
}
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_RolesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = GameModeRole.decode(reader, reader.uint32());
continue;
}
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> =
{
encode(
message: GameDefinitions_RolesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if ((tag & 7) === 4 || tag === 0) {
break;
if (message.value !== undefined) {
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
}
reader.skip(tag & 7);
}
return message;
},
return writer;
},
fromJSON(object: any): GameDefinitions_RolesEntry {
return {
key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)),
value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)),
};
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): GameDefinitions_RolesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_RolesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
toJSON(message: GameDefinitions_RolesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameModeRole.toJSON(message.value);
}
return obj;
},
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(base?: I): GameDefinitions_RolesEntry {
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(object: I): GameDefinitions_RolesEntry {
const message = createBaseGameDefinitions_RolesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? GameModeRole.fromPartial(object.value)
: undefined;
return message;
},
};
message.value = GameModeRole.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): GameDefinitions_RolesEntry {
return {
key: globalThis.Number(
assertSet('GameDefinitions_RolesEntry.key', object.key),
),
value: GameModeRole.fromJSON(
assertSet('GameDefinitions_RolesEntry.value', object.value),
),
};
},
toJSON(message: GameDefinitions_RolesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameModeRole.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
base?: I,
): GameDefinitions_RolesEntry {
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
object: I,
): GameDefinitions_RolesEntry {
const message = createBaseGameDefinitions_RolesEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? GameModeRole.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseGameMode(): GameMode {
return { name: createBaseI18nString() };
}
export const GameMode: MessageFns<GameMode> = {
encode(message: GameMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: GameMode,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join();
}
@@ -356,7 +422,8 @@ export const GameMode: MessageFns<GameMode> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameMode();
while (reader.pos < end) {
@@ -380,7 +447,9 @@ export const GameMode: MessageFns<GameMode> = {
},
fromJSON(object: any): GameMode {
return { name: I18nString.fromJSON(assertSet("GameMode.name", object.name)) };
return {
name: I18nString.fromJSON(assertSet('GameMode.name', object.name)),
};
},
toJSON(message: GameMode): unknown {
@@ -396,9 +465,10 @@ export const GameMode: MessageFns<GameMode> = {
},
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
const message = createBaseGameMode();
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
return message;
},
};
@@ -408,7 +478,10 @@ function createBaseGameModeRole(): GameModeRole {
}
export const GameModeRole: MessageFns<GameModeRole> = {
encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: GameModeRole,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
writer.uint32(10).fork();
for (const v of message.provisions) {
writer.uint32(v);
@@ -423,7 +496,8 @@ export const GameModeRole: MessageFns<GameModeRole> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameModeRole();
while (reader.pos < end) {
@@ -496,10 +570,14 @@ export const GameModeRole: MessageFns<GameModeRole> = {
return obj;
},
create<I extends Exact<DeepPartial<GameModeRole>, I>>(base?: I): GameModeRole {
create<I extends Exact<DeepPartial<GameModeRole>, I>>(
base?: I,
): GameModeRole {
return GameModeRole.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(object: I): GameModeRole {
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(
object: I,
): GameModeRole {
const message = createBaseGameModeRole();
message.provisions = object.provisions?.map((e) => e) || [];
message.consumables = object.consumables?.map((e) => e) || [];
@@ -507,21 +585,36 @@ export const GameModeRole: MessageFns<GameModeRole> = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/i18n.proto
// source: packages/core/src/protos/legacy_i18n.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message MapDefinitions {
map<int32, MapDefinition> maps = 1;
@@ -2,13 +2,13 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/map_definitions.proto
// source: packages/core/src/protos/legacy_map_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = "blitzkit";
export const protobufPackage = 'blitzkit';
export interface MapDefinitions {
maps: { [key: number]: MapDefinition };
@@ -29,15 +29,22 @@ function createBaseMapDefinitions(): MapDefinitions {
}
export const MapDefinitions: MessageFns<MapDefinitions> = {
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: MapDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.maps).forEach(([key, value]) => {
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
MapDefinitions_MapsEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMapDefinitions();
while (reader.pos < end) {
@@ -48,7 +55,10 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
break;
}
const entry1 = MapDefinitions_MapsEntry.decode(reader, reader.uint32());
const entry1 = MapDefinitions_MapsEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.maps[entry1.key] = entry1.value;
}
@@ -66,10 +76,13 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
fromJSON(object: any): MapDefinitions {
return {
maps: isObject(object.maps)
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
return acc;
}, {})
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>(
(acc, [key, value]) => {
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
return acc;
},
{},
)
: {},
};
},
@@ -88,12 +101,18 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
return obj;
},
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(base?: I): MapDefinitions {
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(
base?: I,
): MapDefinitions {
return MapDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(
object: I,
): MapDefinitions {
const message = createBaseMapDefinitions();
message.maps = Object.entries(object.maps ?? {}).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
message.maps = Object.entries(object.maps ?? {}).reduce<{
[key: number]: MapDefinition;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
}
@@ -108,7 +127,10 @@ function createBaseMapDefinitions_MapsEntry(): MapDefinitions_MapsEntry {
}
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
encode(message: MapDefinitions_MapsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: MapDefinitions_MapsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).int32(message.key);
}
@@ -118,8 +140,12 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions_MapsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
decode(
input: BinaryReader | Uint8Array,
length?: number,
): MapDefinitions_MapsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMapDefinitions_MapsEntry();
while (reader.pos < end) {
@@ -152,8 +178,12 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
fromJSON(object: any): MapDefinitions_MapsEntry {
return {
key: globalThis.Number(assertSet("MapDefinitions_MapsEntry.key", object.key)),
value: MapDefinition.fromJSON(assertSet("MapDefinitions_MapsEntry.value", object.value)),
key: globalThis.Number(
assertSet('MapDefinitions_MapsEntry.key', object.key),
),
value: MapDefinition.fromJSON(
assertSet('MapDefinitions_MapsEntry.value', object.value),
),
};
},
@@ -168,15 +198,20 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
return obj;
},
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(base?: I): MapDefinitions_MapsEntry {
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(
base?: I,
): MapDefinitions_MapsEntry {
return MapDefinitions_MapsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(object: I): MapDefinitions_MapsEntry {
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(
object: I,
): MapDefinitions_MapsEntry {
const message = createBaseMapDefinitions_MapsEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? MapDefinition.fromPartial(object.value)
: undefined;
message.value =
object.value !== undefined && object.value !== null
? MapDefinition.fromPartial(object.value)
: undefined;
return message;
},
};
@@ -186,7 +221,10 @@ function createBaseMapDefinition(): MapDefinition {
}
export const MapDefinition: MessageFns<MapDefinition> = {
encode(message: MapDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: MapDefinition,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
@@ -197,7 +235,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMapDefinition();
while (reader.pos < end) {
@@ -230,8 +269,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
fromJSON(object: any): MapDefinition {
return {
id: globalThis.Number(assertSet("MapDefinition.id", object.id)),
name: I18nString.fromJSON(assertSet("MapDefinition.name", object.name)),
id: globalThis.Number(assertSet('MapDefinition.id', object.id)),
name: I18nString.fromJSON(assertSet('MapDefinition.name', object.name)),
};
},
@@ -246,34 +285,54 @@ export const MapDefinition: MessageFns<MapDefinition> = {
return obj;
},
create<I extends Exact<DeepPartial<MapDefinition>, I>>(base?: I): MapDefinition {
create<I extends Exact<DeepPartial<MapDefinition>, I>>(
base?: I,
): MapDefinition {
return MapDefinition.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(object: I): MapDefinition {
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(
object: I,
): MapDefinition {
const message = createBaseMapDefinition();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
@@ -2,6 +2,8 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/utils.proto";
message ModelDefinitions {
map<uint32, ModelDefinition> models = 1;
}
@@ -20,12 +22,6 @@ message Armor {
repeated uint32 spaced = 2;
}
message Vector3 {
required float x = 1;
required float y = 2;
required float z = 3;
}
message InitialTurretRotation {
required float yaw = 1;
required float pitch = 2;
@@ -2,10 +2,11 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/model_definitions.proto
// source: packages/core/src/protos/legacy_model_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Vector3, createBaseVector3 } from "./utils";
export const protobufPackage = "blitzkit";
@@ -47,12 +48,6 @@ export interface Armor_ThicknessEntry {
value: number;
}
export interface Vector3 {
x: number;
y: number;
z: number;
}
export interface InitialTurretRotation {
yaw: number;
pitch: number;
@@ -814,98 +809,6 @@ export const Armor_ThicknessEntry: MessageFns<Armor_ThicknessEntry> = {
},
};
function createBaseVector3(): Vector3 {
return { x: 0, y: 0, z: 0 };
}
export const Vector3: MessageFns<Vector3> = {
encode(message: Vector3, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.x !== 0) {
writer.uint32(13).float(message.x);
}
if (message.y !== 0) {
writer.uint32(21).float(message.y);
}
if (message.z !== 0) {
writer.uint32(29).float(message.z);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Vector3 {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseVector3();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 13) {
break;
}
message.x = reader.float();
continue;
}
case 2: {
if (tag !== 21) {
break;
}
message.y = reader.float();
continue;
}
case 3: {
if (tag !== 29) {
break;
}
message.z = reader.float();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Vector3 {
return {
x: globalThis.Number(assertSet("Vector3.x", object.x)),
y: globalThis.Number(assertSet("Vector3.y", object.y)),
z: globalThis.Number(assertSet("Vector3.z", object.z)),
};
},
toJSON(message: Vector3): unknown {
const obj: any = {};
if (message.x !== 0) {
obj.x = message.x;
}
if (message.y !== 0) {
obj.y = message.y;
}
if (message.z !== 0) {
obj.z = message.z;
}
return obj;
},
create<I extends Exact<DeepPartial<Vector3>, I>>(base?: I): Vector3 {
return Vector3.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Vector3>, I>>(object: I): Vector3 {
const message = createBaseVector3();
message.x = object.x ?? 0;
message.y = object.y ?? 0;
message.z = object.z ?? 0;
return message;
},
};
function createBaseInitialTurretRotation(): InitialTurretRotation {
return { yaw: 0, pitch: 0, roll: 0 };
}
@@ -2,8 +2,8 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/consumable_definitions.proto";
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_consumable_definitions.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message ProvisionDefinitions {
map<uint32, Provision> provisions = 1;
@@ -2,14 +2,14 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/provision_definitions.proto
// source: packages/core/src/protos/legacy_provision_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { ConsumableTankFilter } from "./consumable_definitions";
import { I18nString, createBaseI18nString } from "./i18n";
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { ConsumableTankFilter } from './legacy_consumable_definitions';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = "blitzkit";
export const protobufPackage = 'blitzkit';
export interface ProvisionDefinitions {
provisions: { [key: number]: Provision };
@@ -34,15 +34,25 @@ function createBaseProvisionDefinitions(): ProvisionDefinitions {
}
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: ProvisionDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.provisions).forEach(([key, value]) => {
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
ProvisionDefinitions_ProvisionsEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
decode(
input: BinaryReader | Uint8Array,
length?: number,
): ProvisionDefinitions {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvisionDefinitions();
while (reader.pos < end) {
@@ -53,7 +63,10 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
break;
}
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(reader, reader.uint32());
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.provisions[entry1.key] = entry1.value;
}
@@ -71,10 +84,12 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
fromJSON(object: any): ProvisionDefinitions {
return {
provisions: isObject(object.provisions)
? Object.entries(object.provisions).reduce<{ [key: number]: Provision }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Provision.fromJSON(value);
return acc;
}, {})
? Object.entries(object.provisions).reduce<{
[key: number]: Provision;
}>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Provision.fromJSON(value);
return acc;
}, {})
: {},
};
},
@@ -93,20 +108,23 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
return obj;
},
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(base?: I): ProvisionDefinitions {
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
base?: I,
): ProvisionDefinitions {
return ProvisionDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
object: I,
): ProvisionDefinitions {
const message = createBaseProvisionDefinitions();
message.provisions = Object.entries(object.provisions ?? {}).reduce<{ [key: number]: Provision }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Provision.fromPartial(value);
}
return acc;
},
{},
);
message.provisions = Object.entries(object.provisions ?? {}).reduce<{
[key: number]: Provision;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Provision.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
@@ -115,90 +133,115 @@ function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_
return { key: 0, value: createBaseProvision() };
}
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Provision.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions_ProvisionsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvisionDefinitions_ProvisionsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Provision.decode(reader, reader.uint32());
continue;
}
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> =
{
encode(
message: ProvisionDefinitions_ProvisionsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if ((tag & 7) === 4 || tag === 0) {
break;
if (message.value !== undefined) {
Provision.encode(message.value, writer.uint32(18).fork()).join();
}
reader.skip(tag & 7);
}
return message;
},
return writer;
},
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
return {
key: globalThis.Number(assertSet("ProvisionDefinitions_ProvisionsEntry.key", object.key)),
value: Provision.fromJSON(assertSet("ProvisionDefinitions_ProvisionsEntry.value", object.value)),
};
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): ProvisionDefinitions_ProvisionsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvisionDefinitions_ProvisionsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Provision.toJSON(message.value);
}
return obj;
},
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
create<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
base?: I,
): ProvisionDefinitions_ProvisionsEntry {
return ProvisionDefinitions_ProvisionsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
object: I,
): ProvisionDefinitions_ProvisionsEntry {
const message = createBaseProvisionDefinitions_ProvisionsEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Provision.fromPartial(object.value)
: undefined;
return message;
},
};
message.value = Provision.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
return {
key: globalThis.Number(
assertSet('ProvisionDefinitions_ProvisionsEntry.key', object.key),
),
value: Provision.fromJSON(
assertSet('ProvisionDefinitions_ProvisionsEntry.value', object.value),
),
};
},
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Provision.toJSON(message.value);
}
return obj;
},
create<
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
>(base?: I): ProvisionDefinitions_ProvisionsEntry {
return ProvisionDefinitions_ProvisionsEntry.fromPartial(
base ?? ({} as any),
);
},
fromPartial<
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
>(object: I): ProvisionDefinitions_ProvisionsEntry {
const message = createBaseProvisionDefinitions_ProvisionsEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? Provision.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseProvision(): Provision {
return { id: 0, name: createBaseI18nString(), crew: undefined, game_mode_exclusive: false, include: [], exclude: [] };
return {
id: 0,
name: createBaseI18nString(),
crew: undefined,
game_mode_exclusive: false,
include: [],
exclude: [],
};
}
export const Provision: MessageFns<Provision> = {
encode(message: Provision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: Provision,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
@@ -221,7 +264,8 @@ export const Provision: MessageFns<Provision> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvision();
while (reader.pos < end) {
@@ -264,7 +308,9 @@ export const Provision: MessageFns<Provision> = {
break;
}
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
message.include.push(
ConsumableTankFilter.decode(reader, reader.uint32()),
);
continue;
}
case 7: {
@@ -272,7 +318,9 @@ export const Provision: MessageFns<Provision> = {
break;
}
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
message.exclude.push(
ConsumableTankFilter.decode(reader, reader.uint32()),
);
continue;
}
}
@@ -286,10 +334,12 @@ export const Provision: MessageFns<Provision> = {
fromJSON(object: any): Provision {
return {
id: globalThis.Number(assertSet("Provision.id", object.id)),
name: I18nString.fromJSON(assertSet("Provision.name", object.name)),
id: globalThis.Number(assertSet('Provision.id', object.id)),
name: I18nString.fromJSON(assertSet('Provision.name', object.name)),
crew: isSet(object.crew) ? globalThis.Number(object.crew) : undefined,
game_mode_exclusive: globalThis.Boolean(assertSet("Provision.game_mode_exclusive", object.game_mode_exclusive)),
game_mode_exclusive: globalThis.Boolean(
assertSet('Provision.game_mode_exclusive', object.game_mode_exclusive),
),
include: globalThis.Array.isArray(object?.include)
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
: [],
@@ -325,35 +375,55 @@ export const Provision: MessageFns<Provision> = {
create<I extends Exact<DeepPartial<Provision>, I>>(base?: I): Provision {
return Provision.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(object: I): Provision {
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(
object: I,
): Provision {
const message = createBaseProvision();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.crew = object.crew ?? undefined;
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.include =
object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.exclude =
object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/rating_leaderboard.proto
// source: packages/core/src/protos/legacy_rating_leaderboard.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/skill_definitions.proto
// source: packages/core/src/protos/legacy_skill_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message TankDefinitions {
map<uint32, TankDefinition> tanks = 1;
@@ -10,16 +10,16 @@ message TankDefinitions {
message TankDefinition {
required uint32 id = 1;
required string slug = 2;
map<uint32, uint32> roles = 3;
required bool fixed_camouflage = 5;
repeated int32 camouflages = 6;
repeated int32 ancestors = 7;
repeated int32 successors = 8;
repeated Crew crew = 9;
required uint32 health = 10;
required string nation = 11;
required I18nString name = 12;
map<uint32, uint32> roles = 2;
required bool fixed_camouflage = 4;
repeated int32 camouflages = 5;
repeated int32 ancestors = 6;
repeated int32 successors = 7;
repeated Crew crew = 8;
required uint32 health = 9;
required string nation = 10;
required I18nString name = 11;
optional I18nString name_full = 12;
required TankType type = 13;
required uint32 max_consumables = 14;
required uint32 max_provisions = 15;
@@ -2,11 +2,11 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank_definitions.proto
// source: packages/core/src/protos/legacy_tank_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './i18n';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = 'blitzkit';
@@ -285,7 +285,6 @@ export interface TankDefinitions_TanksEntry {
export interface TankDefinition {
id: number;
slug: string;
roles: { [key: number]: number };
fixed_camouflage: boolean;
camouflages: number[];
@@ -295,6 +294,7 @@ export interface TankDefinition {
health: number;
nation: string;
name: I18nString;
name_full?: I18nString | undefined;
type: TankType;
max_consumables: number;
max_provisions: number;
@@ -667,7 +667,6 @@ export const TankDefinitions_TanksEntry: MessageFns<TankDefinitions_TanksEntry>
function createBaseTankDefinition(): TankDefinition {
return {
id: 0,
slug: '',
roles: {},
fixed_camouflage: false,
camouflages: [],
@@ -677,6 +676,7 @@ function createBaseTankDefinition(): TankDefinition {
health: 0,
nation: '',
name: createBaseI18nString(),
name_full: undefined,
type: 0,
max_consumables: 0,
max_provisions: 0,
@@ -707,44 +707,44 @@ export const TankDefinition: MessageFns<TankDefinition> = {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.slug !== '') {
writer.uint32(18).string(message.slug);
}
Object.entries(message.roles).forEach(([key, value]) => {
TankDefinition_RolesEntry.encode(
{ key: key as any, value },
writer.uint32(26).fork(),
writer.uint32(18).fork(),
).join();
});
if (message.fixed_camouflage !== false) {
writer.uint32(40).bool(message.fixed_camouflage);
writer.uint32(32).bool(message.fixed_camouflage);
}
writer.uint32(50).fork();
writer.uint32(42).fork();
for (const v of message.camouflages) {
writer.int32(v);
}
writer.join();
writer.uint32(58).fork();
writer.uint32(50).fork();
for (const v of message.ancestors) {
writer.int32(v);
}
writer.join();
writer.uint32(66).fork();
writer.uint32(58).fork();
for (const v of message.successors) {
writer.int32(v);
}
writer.join();
for (const v of message.crew) {
Crew.encode(v!, writer.uint32(74).fork()).join();
Crew.encode(v!, writer.uint32(66).fork()).join();
}
if (message.health !== 0) {
writer.uint32(80).uint32(message.health);
writer.uint32(72).uint32(message.health);
}
if (message.nation !== '') {
writer.uint32(90).string(message.nation);
writer.uint32(82).string(message.nation);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(98).fork()).join();
I18nString.encode(message.name, writer.uint32(90).fork()).join();
}
if (message.name_full !== undefined) {
I18nString.encode(message.name_full, writer.uint32(98).fork()).join();
}
if (message.type !== 0) {
writer.uint32(104).int32(message.type);
@@ -830,39 +830,31 @@ export const TankDefinition: MessageFns<TankDefinition> = {
break;
}
message.slug = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
const entry3 = TankDefinition_RolesEntry.decode(
const entry2 = TankDefinition_RolesEntry.decode(
reader,
reader.uint32(),
);
if (entry3.value !== undefined) {
message.roles[entry3.key] = entry3.value;
if (entry2.value !== undefined) {
message.roles[entry2.key] = entry2.value;
}
continue;
}
case 5: {
if (tag !== 40) {
case 4: {
if (tag !== 32) {
break;
}
message.fixed_camouflage = reader.bool();
continue;
}
case 6: {
if (tag === 48) {
case 5: {
if (tag === 40) {
message.camouflages.push(reader.int32());
continue;
}
if (tag === 50) {
if (tag === 42) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.camouflages.push(reader.int32());
@@ -873,14 +865,14 @@ export const TankDefinition: MessageFns<TankDefinition> = {
break;
}
case 7: {
if (tag === 56) {
case 6: {
if (tag === 48) {
message.ancestors.push(reader.int32());
continue;
}
if (tag === 58) {
if (tag === 50) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ancestors.push(reader.int32());
@@ -891,14 +883,14 @@ export const TankDefinition: MessageFns<TankDefinition> = {
break;
}
case 8: {
if (tag === 64) {
case 7: {
if (tag === 56) {
message.successors.push(reader.int32());
continue;
}
if (tag === 66) {
if (tag === 58) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.successors.push(reader.int32());
@@ -909,28 +901,36 @@ export const TankDefinition: MessageFns<TankDefinition> = {
break;
}
case 9: {
if (tag !== 74) {
case 8: {
if (tag !== 66) {
break;
}
message.crew.push(Crew.decode(reader, reader.uint32()));
continue;
}
case 10: {
if (tag !== 80) {
case 9: {
if (tag !== 72) {
break;
}
message.health = reader.uint32();
continue;
}
case 10: {
if (tag !== 82) {
break;
}
message.nation = reader.string();
continue;
}
case 11: {
if (tag !== 90) {
break;
}
message.nation = reader.string();
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 12: {
@@ -938,7 +938,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
message.name_full = I18nString.decode(reader, reader.uint32());
continue;
}
case 13: {
@@ -1109,7 +1109,6 @@ export const TankDefinition: MessageFns<TankDefinition> = {
fromJSON(object: any): TankDefinition {
return {
id: globalThis.Number(assertSet('TankDefinition.id', object.id)),
slug: globalThis.String(assertSet('TankDefinition.slug', object.slug)),
roles: isObject(object.roles)
? Object.entries(object.roles).reduce<{ [key: number]: number }>(
(acc, [key, value]) => {
@@ -1141,6 +1140,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
assertSet('TankDefinition.nation', object.nation),
),
name: I18nString.fromJSON(assertSet('TankDefinition.name', object.name)),
name_full: isSet(object.name_full)
? I18nString.fromJSON(object.name_full)
: undefined,
type: tankTypeFromJSON(assertSet('TankDefinition.type', object.type)),
max_consumables: globalThis.Number(
assertSet('TankDefinition.max_consumables', object.max_consumables),
@@ -1200,9 +1202,6 @@ export const TankDefinition: MessageFns<TankDefinition> = {
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.slug !== '') {
obj.slug = message.slug;
}
if (message.roles) {
const entries = Object.entries(message.roles);
if (entries.length > 0) {
@@ -1236,6 +1235,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.name_full !== undefined) {
obj.name_full = I18nString.toJSON(message.name_full);
}
if (message.type !== 0) {
obj.type = tankTypeToJSON(message.type);
}
@@ -1306,7 +1308,6 @@ export const TankDefinition: MessageFns<TankDefinition> = {
): TankDefinition {
const message = createBaseTankDefinition();
message.id = object.id ?? 0;
message.slug = object.slug ?? '';
message.roles = Object.entries(object.roles ?? {}).reduce<{
[key: number]: number;
}>((acc, [key, value]) => {
@@ -1326,6 +1327,10 @@ export const TankDefinition: MessageFns<TankDefinition> = {
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name_full =
object.name_full !== undefined && object.name_full !== null
? I18nString.fromPartial(object.name_full)
: undefined;
message.type = object.type ?? 0;
message.max_consumables = object.max_consumables ?? 0;
message.max_provisions = object.max_provisions ?? 0;
@@ -1,12 +0,0 @@
syntax = "proto2";
package blitzkit;
message PopularTanks {
repeated PopularTank tanks = 1;
}
message PopularTank {
required uint32 id = 1;
required uint32 views = 2; // views in the last 7 days
}
-190
View File
@@ -1,190 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/popular_tanks.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface PopularTanks {
tanks: PopularTank[];
}
export interface PopularTank {
id: number;
/** views in the last 7 days */
views: number;
}
function createBasePopularTanks(): PopularTanks {
return { tanks: [] };
}
export const PopularTanks: MessageFns<PopularTanks> = {
encode(message: PopularTanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
PopularTank.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): PopularTanks {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePopularTanks();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(PopularTank.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): PopularTanks {
return {
tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => PopularTank.fromJSON(e)) : [],
};
},
toJSON(message: PopularTanks): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks.map((e) => PopularTank.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<PopularTanks>, I>>(base?: I): PopularTanks {
return PopularTanks.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<PopularTanks>, I>>(object: I): PopularTanks {
const message = createBasePopularTanks();
message.tanks = object.tanks?.map((e) => PopularTank.fromPartial(e)) || [];
return message;
},
};
function createBasePopularTank(): PopularTank {
return { id: 0, views: 0 };
}
export const PopularTank: MessageFns<PopularTank> = {
encode(message: PopularTank, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.views !== 0) {
writer.uint32(16).uint32(message.views);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): PopularTank {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePopularTank();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.views = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): PopularTank {
return {
id: globalThis.Number(assertSet("PopularTank.id", object.id)),
views: globalThis.Number(assertSet("PopularTank.views", object.views)),
};
},
toJSON(message: PopularTank): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.views !== 0) {
obj.views = Math.round(message.views);
}
return obj;
},
create<I extends Exact<DeepPartial<PopularTank>, I>>(base?: I): PopularTank {
return PopularTank.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<PopularTank>, I>>(object: I): PopularTank {
const message = createBasePopularTank();
message.id = object.id ?? 0;
message.views = object.views ?? 0;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+21
View File
@@ -0,0 +1,21 @@
syntax = "proto2";
import "packages/core/src/protos/utils.proto";
package blitzkit;
message Tank {
required string id = 1;
required string slug = 2;
required I18n name = 3;
map<string, Turret> turrets = 4;
map<string, Gun> guns = 5;
}
message Turret {
required string id = 1;
}
message Gun {
required string id = 1;
}
+509
View File
@@ -0,0 +1,509 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18n, createBaseI18n } from "./utils";
export const protobufPackage = "blitzkit";
export interface Tank {
id: string;
slug: string;
name: I18n;
turrets: { [key: string]: Turret };
guns: { [key: string]: Gun };
}
export interface Tank_TurretsEntry {
key: string;
value: Turret | undefined;
}
export interface Tank_GunsEntry {
key: string;
value: Gun | undefined;
}
export interface Turret {
id: string;
}
export interface Gun {
id: string;
}
function createBaseTank(): Tank {
return { id: "", slug: "", name: createBaseI18n(), turrets: {}, guns: {} };
}
export const Tank: MessageFns<Tank> = {
encode(message: Tank, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.slug !== "") {
writer.uint32(18).string(message.slug);
}
if (message.name !== undefined) {
I18n.encode(message.name, writer.uint32(26).fork()).join();
}
Object.entries(message.turrets).forEach(([key, value]) => {
Tank_TurretsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
});
Object.entries(message.guns).forEach(([key, value]) => {
Tank_GunsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tank {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.slug = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.name = I18n.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
const entry4 = Tank_TurretsEntry.decode(reader, reader.uint32());
if (entry4.value !== undefined) {
message.turrets[entry4.key] = entry4.value;
}
continue;
}
case 5: {
if (tag !== 42) {
break;
}
const entry5 = Tank_GunsEntry.decode(reader, reader.uint32());
if (entry5.value !== undefined) {
message.guns[entry5.key] = entry5.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tank {
return {
id: globalThis.String(assertSet("Tank.id", object.id)),
slug: globalThis.String(assertSet("Tank.slug", object.slug)),
name: I18n.fromJSON(assertSet("Tank.name", object.name)),
turrets: isObject(object.turrets)
? Object.entries(object.turrets).reduce<{ [key: string]: Turret }>((acc, [key, value]) => {
acc[key] = Turret.fromJSON(value);
return acc;
}, {})
: {},
guns: isObject(object.guns)
? Object.entries(object.guns).reduce<{ [key: string]: Gun }>((acc, [key, value]) => {
acc[key] = Gun.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: Tank): unknown {
const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
if (message.slug !== "") {
obj.slug = message.slug;
}
if (message.name !== undefined) {
obj.name = I18n.toJSON(message.name);
}
if (message.turrets) {
const entries = Object.entries(message.turrets);
if (entries.length > 0) {
obj.turrets = {};
entries.forEach(([k, v]) => {
obj.turrets[k] = Turret.toJSON(v);
});
}
}
if (message.guns) {
const entries = Object.entries(message.guns);
if (entries.length > 0) {
obj.guns = {};
entries.forEach(([k, v]) => {
obj.guns[k] = Gun.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<Tank>, I>>(base?: I): Tank {
return Tank.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tank>, I>>(object: I): Tank {
const message = createBaseTank();
message.id = object.id ?? "";
message.slug = object.slug ?? "";
message.name = (object.name !== undefined && object.name !== null)
? I18n.fromPartial(object.name)
: createBaseI18n();
message.turrets = Object.entries(object.turrets ?? {}).reduce<{ [key: string]: Turret }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = Turret.fromPartial(value);
}
return acc;
}, {});
message.guns = Object.entries(object.guns ?? {}).reduce<{ [key: string]: Gun }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = Gun.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseTank_TurretsEntry(): Tank_TurretsEntry {
return { key: "", value: createBaseTurret() };
}
export const Tank_TurretsEntry: MessageFns<Tank_TurretsEntry> = {
encode(message: Tank_TurretsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
Turret.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tank_TurretsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank_TurretsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Turret.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tank_TurretsEntry {
return {
key: globalThis.String(assertSet("Tank_TurretsEntry.key", object.key)),
value: Turret.fromJSON(assertSet("Tank_TurretsEntry.value", object.value)),
};
},
toJSON(message: Tank_TurretsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = Turret.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<Tank_TurretsEntry>, I>>(base?: I): Tank_TurretsEntry {
return Tank_TurretsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tank_TurretsEntry>, I>>(object: I): Tank_TurretsEntry {
const message = createBaseTank_TurretsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? Turret.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseTank_GunsEntry(): Tank_GunsEntry {
return { key: "", value: createBaseGun() };
}
export const Tank_GunsEntry: MessageFns<Tank_GunsEntry> = {
encode(message: Tank_GunsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
Gun.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tank_GunsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank_GunsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Gun.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tank_GunsEntry {
return {
key: globalThis.String(assertSet("Tank_GunsEntry.key", object.key)),
value: Gun.fromJSON(assertSet("Tank_GunsEntry.value", object.value)),
};
},
toJSON(message: Tank_GunsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = Gun.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<Tank_GunsEntry>, I>>(base?: I): Tank_GunsEntry {
return Tank_GunsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tank_GunsEntry>, I>>(object: I): Tank_GunsEntry {
const message = createBaseTank_GunsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null) ? Gun.fromPartial(object.value) : undefined;
return message;
},
};
function createBaseTurret(): Turret {
return { id: "" };
}
export const Turret: MessageFns<Turret> = {
encode(message: Turret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Turret {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTurret();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Turret {
return { id: globalThis.String(assertSet("Turret.id", object.id)) };
},
toJSON(message: Turret): unknown {
const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create<I extends Exact<DeepPartial<Turret>, I>>(base?: I): Turret {
return Turret.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Turret>, I>>(object: I): Turret {
const message = createBaseTurret();
message.id = object.id ?? "";
return message;
},
};
function createBaseGun(): Gun {
return { id: "" };
}
export const Gun: MessageFns<Gun> = {
encode(message: Gun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Gun {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGun();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Gun {
return { id: globalThis.String(assertSet("Gun.id", object.id)) };
},
toJSON(message: Gun): unknown {
const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create<I extends Exact<DeepPartial<Gun>, I>>(base?: I): Gun {
return Gun.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Gun>, I>>(object: I): Gun {
const message = createBaseGun();
message.id = object.id ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+21
View File
@@ -0,0 +1,21 @@
syntax = "proto2";
package blitzkit;
message TankArmor {
// key can only ever be "chassis", "hull", "turret", or "gun"
map<string, PenetrationGroup> groups = 1;
}
message PenetrationGroup {
// keys are mostly "armor_xyz" where xyz is an integer but sometimes can be
// things like "commander", "rightTrack", etc.
map<string, ArmorPlate> armors = 1;
}
message ArmorPlate {
// this is the thickness of the armor in millimeters
required float thickness = 1;
// this can be stuff like ArmorScreen which is spaced armor, FuelTank, etc.
required string type = 2;
}
+471
View File
@@ -0,0 +1,471 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank_armor.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface TankArmor {
/** key can only ever be "chassis", "hull", "turret", or "gun" */
groups: { [key: string]: PenetrationGroup };
}
export interface TankArmor_GroupsEntry {
key: string;
value: PenetrationGroup | undefined;
}
export interface PenetrationGroup {
/**
* keys are mostly "armor_xyz" where xyz is an integer but sometimes can be
* things like "commander", "rightTrack", etc.
*/
armors: { [key: string]: ArmorPlate };
}
export interface PenetrationGroup_ArmorsEntry {
key: string;
value: ArmorPlate | undefined;
}
export interface ArmorPlate {
/** this is the thickness of the armor in millimeters */
thickness: number;
/** this can be stuff like ArmorScreen which is spaced armor, FuelTank, etc. */
type: string;
}
function createBaseTankArmor(): TankArmor {
return { groups: {} };
}
export const TankArmor: MessageFns<TankArmor> = {
encode(message: TankArmor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.groups).forEach(([key, value]) => {
TankArmor_GroupsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankArmor {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankArmor();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = TankArmor_GroupsEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.groups[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankArmor {
return {
groups: isObject(object.groups)
? Object.entries(object.groups).reduce<{ [key: string]: PenetrationGroup }>((acc, [key, value]) => {
acc[key] = PenetrationGroup.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: TankArmor): unknown {
const obj: any = {};
if (message.groups) {
const entries = Object.entries(message.groups);
if (entries.length > 0) {
obj.groups = {};
entries.forEach(([k, v]) => {
obj.groups[k] = PenetrationGroup.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<TankArmor>, I>>(base?: I): TankArmor {
return TankArmor.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankArmor>, I>>(object: I): TankArmor {
const message = createBaseTankArmor();
message.groups = Object.entries(object.groups ?? {}).reduce<{ [key: string]: PenetrationGroup }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = PenetrationGroup.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseTankArmor_GroupsEntry(): TankArmor_GroupsEntry {
return { key: "", value: createBasePenetrationGroup() };
}
export const TankArmor_GroupsEntry: MessageFns<TankArmor_GroupsEntry> = {
encode(message: TankArmor_GroupsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
PenetrationGroup.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankArmor_GroupsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankArmor_GroupsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = PenetrationGroup.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankArmor_GroupsEntry {
return {
key: globalThis.String(assertSet("TankArmor_GroupsEntry.key", object.key)),
value: PenetrationGroup.fromJSON(assertSet("TankArmor_GroupsEntry.value", object.value)),
};
},
toJSON(message: TankArmor_GroupsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = PenetrationGroup.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<TankArmor_GroupsEntry>, I>>(base?: I): TankArmor_GroupsEntry {
return TankArmor_GroupsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankArmor_GroupsEntry>, I>>(object: I): TankArmor_GroupsEntry {
const message = createBaseTankArmor_GroupsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? PenetrationGroup.fromPartial(object.value)
: undefined;
return message;
},
};
function createBasePenetrationGroup(): PenetrationGroup {
return { armors: {} };
}
export const PenetrationGroup: MessageFns<PenetrationGroup> = {
encode(message: PenetrationGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.armors).forEach(([key, value]) => {
PenetrationGroup_ArmorsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): PenetrationGroup {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePenetrationGroup();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = PenetrationGroup_ArmorsEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.armors[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): PenetrationGroup {
return {
armors: isObject(object.armors)
? Object.entries(object.armors).reduce<{ [key: string]: ArmorPlate }>((acc, [key, value]) => {
acc[key] = ArmorPlate.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: PenetrationGroup): unknown {
const obj: any = {};
if (message.armors) {
const entries = Object.entries(message.armors);
if (entries.length > 0) {
obj.armors = {};
entries.forEach(([k, v]) => {
obj.armors[k] = ArmorPlate.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<PenetrationGroup>, I>>(base?: I): PenetrationGroup {
return PenetrationGroup.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<PenetrationGroup>, I>>(object: I): PenetrationGroup {
const message = createBasePenetrationGroup();
message.armors = Object.entries(object.armors ?? {}).reduce<{ [key: string]: ArmorPlate }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = ArmorPlate.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBasePenetrationGroup_ArmorsEntry(): PenetrationGroup_ArmorsEntry {
return { key: "", value: createBaseArmorPlate() };
}
export const PenetrationGroup_ArmorsEntry: MessageFns<PenetrationGroup_ArmorsEntry> = {
encode(message: PenetrationGroup_ArmorsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
ArmorPlate.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): PenetrationGroup_ArmorsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePenetrationGroup_ArmorsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = ArmorPlate.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): PenetrationGroup_ArmorsEntry {
return {
key: globalThis.String(assertSet("PenetrationGroup_ArmorsEntry.key", object.key)),
value: ArmorPlate.fromJSON(assertSet("PenetrationGroup_ArmorsEntry.value", object.value)),
};
},
toJSON(message: PenetrationGroup_ArmorsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = ArmorPlate.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<PenetrationGroup_ArmorsEntry>, I>>(base?: I): PenetrationGroup_ArmorsEntry {
return PenetrationGroup_ArmorsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<PenetrationGroup_ArmorsEntry>, I>>(object: I): PenetrationGroup_ArmorsEntry {
const message = createBasePenetrationGroup_ArmorsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? ArmorPlate.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseArmorPlate(): ArmorPlate {
return { thickness: 0, type: "" };
}
export const ArmorPlate: MessageFns<ArmorPlate> = {
encode(message: ArmorPlate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.thickness !== 0) {
writer.uint32(13).float(message.thickness);
}
if (message.type !== "") {
writer.uint32(18).string(message.type);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ArmorPlate {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseArmorPlate();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 13) {
break;
}
message.thickness = reader.float();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.type = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ArmorPlate {
return {
thickness: globalThis.Number(assertSet("ArmorPlate.thickness", object.thickness)),
type: globalThis.String(assertSet("ArmorPlate.type", object.type)),
};
},
toJSON(message: ArmorPlate): unknown {
const obj: any = {};
if (message.thickness !== 0) {
obj.thickness = message.thickness;
}
if (message.type !== "") {
obj.type = message.type;
}
return obj;
},
create<I extends Exact<DeepPartial<ArmorPlate>, I>>(base?: I): ArmorPlate {
return ArmorPlate.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ArmorPlate>, I>>(object: I): ArmorPlate {
const message = createBaseArmorPlate();
message.thickness = object.thickness ?? 0;
message.type = object.type ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+13
View File
@@ -0,0 +1,13 @@
syntax = "proto2";
import "packages/core/src/protos/utils.proto";
package blitzkit;
message TankModel {
map<string, ModuleModel> modules = 1;
}
message ModuleModel {
required Vector3 translation = 2;
}
+282
View File
@@ -0,0 +1,282 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank_model.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Vector3, createBaseVector3 } from "./utils";
export const protobufPackage = "blitzkit";
export interface TankModel {
modules: { [key: string]: ModuleModel };
}
export interface TankModel_ModulesEntry {
key: string;
value: ModuleModel | undefined;
}
export interface ModuleModel {
translation: Vector3;
}
function createBaseTankModel(): TankModel {
return { modules: {} };
}
export const TankModel: MessageFns<TankModel> = {
encode(message: TankModel, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.modules).forEach(([key, value]) => {
TankModel_ModulesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankModel {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankModel();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = TankModel_ModulesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.modules[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankModel {
return {
modules: isObject(object.modules)
? Object.entries(object.modules).reduce<{ [key: string]: ModuleModel }>((acc, [key, value]) => {
acc[key] = ModuleModel.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: TankModel): unknown {
const obj: any = {};
if (message.modules) {
const entries = Object.entries(message.modules);
if (entries.length > 0) {
obj.modules = {};
entries.forEach(([k, v]) => {
obj.modules[k] = ModuleModel.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<TankModel>, I>>(base?: I): TankModel {
return TankModel.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankModel>, I>>(object: I): TankModel {
const message = createBaseTankModel();
message.modules = Object.entries(object.modules ?? {}).reduce<{ [key: string]: ModuleModel }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = ModuleModel.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseTankModel_ModulesEntry(): TankModel_ModulesEntry {
return { key: "", value: createBaseModuleModel() };
}
export const TankModel_ModulesEntry: MessageFns<TankModel_ModulesEntry> = {
encode(message: TankModel_ModulesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
ModuleModel.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankModel_ModulesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankModel_ModulesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = ModuleModel.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankModel_ModulesEntry {
return {
key: globalThis.String(assertSet("TankModel_ModulesEntry.key", object.key)),
value: ModuleModel.fromJSON(assertSet("TankModel_ModulesEntry.value", object.value)),
};
},
toJSON(message: TankModel_ModulesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = ModuleModel.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<TankModel_ModulesEntry>, I>>(base?: I): TankModel_ModulesEntry {
return TankModel_ModulesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankModel_ModulesEntry>, I>>(object: I): TankModel_ModulesEntry {
const message = createBaseTankModel_ModulesEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? ModuleModel.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseModuleModel(): ModuleModel {
return { translation: createBaseVector3() };
}
export const ModuleModel: MessageFns<ModuleModel> = {
encode(message: ModuleModel, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.translation !== undefined) {
Vector3.encode(message.translation, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ModuleModel {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseModuleModel();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
if (tag !== 18) {
break;
}
message.translation = Vector3.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ModuleModel {
return { translation: Vector3.fromJSON(assertSet("ModuleModel.translation", object.translation)) };
},
toJSON(message: ModuleModel): unknown {
const obj: any = {};
if (message.translation !== undefined) {
obj.translation = Vector3.toJSON(message.translation);
}
return obj;
},
create<I extends Exact<DeepPartial<ModuleModel>, I>>(base?: I): ModuleModel {
return ModuleModel.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ModuleModel>, I>>(object: I): ModuleModel {
const message = createBaseModuleModel();
message.translation = (object.translation !== undefined && object.translation !== null)
? Vector3.fromPartial(object.translation)
: createBaseVector3();
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+7
View File
@@ -0,0 +1,7 @@
syntax = "proto2";
package blitzkit;
message Tanks {
repeated string tanks = 1;
}
+94
View File
@@ -0,0 +1,94 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tanks.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface Tanks {
tanks: string[];
}
function createBaseTanks(): Tanks {
return { tanks: [] };
}
export const Tanks: MessageFns<Tanks> = {
encode(message: Tanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tanks {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTanks();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tanks {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => globalThis.String(e)) : [] };
},
toJSON(message: Tanks): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks;
}
return obj;
},
create<I extends Exact<DeepPartial<Tanks>, I>>(base?: I): Tanks {
return Tanks.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tanks>, I>>(object: I): Tanks {
const message = createBaseTanks();
message.tanks = object.tanks?.map((e) => e) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -0,0 +1,9 @@
syntax = "proto2";
import "packages/core/src/protos/tank.proto";
package blitzkit;
message TanksFull {
repeated Tank tanks = 1;
}
+95
View File
@@ -0,0 +1,95 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tanks_full.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Tank } from "./tank";
export const protobufPackage = "blitzkit";
export interface TanksFull {
tanks: Tank[];
}
function createBaseTanksFull(): TanksFull {
return { tanks: [] };
}
export const TanksFull: MessageFns<TanksFull> = {
encode(message: TanksFull, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
Tank.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TanksFull {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTanksFull();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(Tank.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TanksFull {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => Tank.fromJSON(e)) : [] };
},
toJSON(message: TanksFull): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks.map((e) => Tank.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<TanksFull>, I>>(base?: I): TanksFull {
return TanksFull.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TanksFull>, I>>(object: I): TanksFull {
const message = createBaseTanksFull();
message.tanks = object.tanks?.map((e) => Tank.fromPartial(e)) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+13
View File
@@ -0,0 +1,13 @@
syntax = "proto2";
package blitzkit;
message Vector3 {
required float x = 1;
required float y = 2;
required float z = 3;
}
message I18n {
map<string, string> locales = 1;
}
+310
View File
@@ -0,0 +1,310 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/utils.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface Vector3 {
x: number;
y: number;
z: number;
}
export interface I18n {
locales: { [key: string]: string };
}
export interface I18n_LocalesEntry {
key: string;
value: string;
}
export function createBaseVector3(): Vector3 {
return { x: 0, y: 0, z: 0 };
}
export const Vector3: MessageFns<Vector3> = {
encode(message: Vector3, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.x !== 0) {
writer.uint32(13).float(message.x);
}
if (message.y !== 0) {
writer.uint32(21).float(message.y);
}
if (message.z !== 0) {
writer.uint32(29).float(message.z);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Vector3 {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseVector3();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 13) {
break;
}
message.x = reader.float();
continue;
}
case 2: {
if (tag !== 21) {
break;
}
message.y = reader.float();
continue;
}
case 3: {
if (tag !== 29) {
break;
}
message.z = reader.float();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Vector3 {
return {
x: globalThis.Number(assertSet("Vector3.x", object.x)),
y: globalThis.Number(assertSet("Vector3.y", object.y)),
z: globalThis.Number(assertSet("Vector3.z", object.z)),
};
},
toJSON(message: Vector3): unknown {
const obj: any = {};
if (message.x !== 0) {
obj.x = message.x;
}
if (message.y !== 0) {
obj.y = message.y;
}
if (message.z !== 0) {
obj.z = message.z;
}
return obj;
},
create<I extends Exact<DeepPartial<Vector3>, I>>(base?: I): Vector3 {
return Vector3.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Vector3>, I>>(object: I): Vector3 {
const message = createBaseVector3();
message.x = object.x ?? 0;
message.y = object.y ?? 0;
message.z = object.z ?? 0;
return message;
},
};
export function createBaseI18n(): I18n {
return { locales: {} };
}
export const I18n: MessageFns<I18n> = {
encode(message: I18n, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.locales).forEach(([key, value]) => {
I18n_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): I18n {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18n();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = I18n_LocalesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.locales[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): I18n {
return {
locales: isObject(object.locales)
? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => {
acc[key] = String(value);
return acc;
}, {})
: {},
};
},
toJSON(message: I18n): unknown {
const obj: any = {};
if (message.locales) {
const entries = Object.entries(message.locales);
if (entries.length > 0) {
obj.locales = {};
entries.forEach(([k, v]) => {
obj.locales[k] = v;
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<I18n>, I>>(base?: I): I18n {
return I18n.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<I18n>, I>>(object: I): I18n {
const message = createBaseI18n();
message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = globalThis.String(value);
}
return acc;
}, {});
return message;
},
};
function createBaseI18n_LocalesEntry(): I18n_LocalesEntry {
return { key: "", value: "" };
}
export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = {
encode(message: I18n_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
writer.uint32(18).string(message.value);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): I18n_LocalesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18n_LocalesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): I18n_LocalesEntry {
return {
key: globalThis.String(assertSet("I18n_LocalesEntry.key", object.key)),
value: globalThis.String(assertSet("I18n_LocalesEntry.value", object.value)),
};
},
toJSON(message: I18n_LocalesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = message.value;
}
return obj;
},
create<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>(base?: I): I18n_LocalesEntry {
return I18n_LocalesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>(object: I): I18n_LocalesEntry {
const message = createBaseI18n_LocalesEntry();
message.key = object.key ?? "";
message.value = object.value ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+22 -61
View File
@@ -11,9 +11,7 @@
"mm": "%s1mm",
"deg": "%s1°",
"hp": "%s1hp",
"x": "x%s1",
"percentage": "%s1%",
"deg_s": "%s1°/s"
"x": "x%s1"
},
"gun_types": {
@@ -741,11 +739,6 @@
},
"website": {
"redirect": {
"title": "301: moved permanently",
"body": "This page has moved. Redirecting..."
},
"settings": {
"dev_mode": "Development mode",
"language": "Language"
@@ -763,7 +756,7 @@
},
"tank_search": {
"clear_filters": "Clear filters",
"clear_filters": "Clear",
"search_bar_hint": "Search tanks...",
"recent": "Recently viewed",
"select_all": "Select all",
@@ -860,24 +853,14 @@
},
"tools": {
"guess": {
"name": "Guess the tank",
"button": "Guess away",
"description": "Silhouette mini-game",
"seo_description": "Play a tank guessing game with a silhouette in World of Tanks Blitz",
"search": {
"placeholder": "Type to guess...",
"skip": "Skip",
"guess": "Guess",
"next": "Next",
"no_results": "No results"
},
"stats": "%s1 / %s2 guessed correctly"
"api": {
"name": "API",
"button": "Nerd out",
"description": "BlitzKit API docs",
"seo_description": "Comprehensive documentation and detailed insights into BlitzKit's API, enabling developers to integrate and utilize advanced features for World of Tanks Blitz efficiently."
},
"tankopedia": {
"search": "Search a stat...",
"tanks": {
"name": "Tankopedia",
"button": "Find tanks",
"description": "Blitz tank encyclopedia",
@@ -885,33 +868,11 @@
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
"visualizers": {
"rotator": {
"hull": "Hull",
"turret": "Turret",
"hard": "Hard",
"medium": "Medium",
"soft": "Soft",
"effective": "Effective"
},
"ricochet": {
"angle": "Angle",
"normalization": "Normalization",
"effective_angle": "Effective angle",
"armor": "Armor",
"no_ricochet": "Explosive shells don't ricochet"
},
"view_range": {
"camo": "Camo",
"percentage": "%s1%",
"ghost_factory": "Ghost Factory",
"dead_rail": "Dead Rail"
}
},
"sandbox": {
"dissector": {
"name": "Dissector"
},
"poses": {
"hull_down": "Hull down",
"face_hug": "Face hug",
@@ -957,7 +918,7 @@
"element": {
"primary": "Primary",
"spaced": "Spaced",
"external": "External",
"modules": "Modules",
"gap": "Gap",
"gun": "Gun",
"track": "Tracks"
@@ -979,7 +940,7 @@
"name": "Static armor",
"primary": "Primary",
"spaced": "Spaced",
"external": "External",
"modules": "Modules",
"edit": {
"label": "Edit",
"reset": "Reset"
@@ -1060,7 +1021,7 @@
"characteristics": {
"title": "Characteristics",
"compare": {
"label": "Compare",
"label": "Compare against",
"class": "Tier %s1 %s2",
"tier": "All of tier %s1",
"all": "All tanks"
@@ -1097,7 +1058,7 @@
"explosionRadius": "Explosion radius",
"shellVelocity": "Shell velocity",
"aimTime": "Aim time",
"dispersion": "Dispersion still",
"dispersion": "Still",
"dispersionMoving": "Moving",
"dispersionHullTraversing": "Hull traversing",
"dispersionTurretTraversing": "Turret traversing",
@@ -1111,28 +1072,28 @@
"gunRearElevation": "Rear elevation",
"azimuthLeft": "Azimuth left",
"azimuthRight": "Azimuth right",
"speedForwards": "Speed forwards",
"speedForwards": "Forwards",
"speedBackwards": "Backwards",
"hardTerrainCoefficient": "Terrain coefficient hard",
"hardTerrainCoefficientRaw": "Raw terrain coefficient hard",
"hardTerrainCoefficient": "Hard",
"hardTerrainCoefficientRaw": "Hard",
"mediumTerrainCoefficient": "Medium",
"mediumTerrainCoefficientRaw": "Medium",
"softTerrainCoefficient": "Soft",
"softTerrainCoefficientRaw": "Soft",
"enginePower": "Engine power",
"powerToWeightRatioHardTerrain": "Power to weight ratio hard",
"powerToWeightRatioHardTerrain": "Hard",
"powerToWeightRatioMediumTerrain": "Medium",
"powerToWeightRatioSoftTerrain": "Soft",
"weight": "Weight",
"turretTraverseSpeed": "Turret traverse speed",
"gunTraverseSpeed": "Gun traverse speed",
"hullTraverseHardTerrain": "Hull traverse hard",
"hullTraverseHardTerrain": "Hard",
"hullTraverseMediumTerrain": "Medium",
"hullTraverseSoftTerrain": "Soft",
"health": "Health",
"fireChance": "Fire chance",
"viewRange": "View range",
"camouflageStill": "Camouflage still",
"camouflageStill": "Still",
"camouflageMoving": "Moving",
"camouflageShootingStill": "Still",
"camouflageShootingMoving": "Moving",
+1 -13
View File
@@ -665,7 +665,6 @@
"copied": "Copiado!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "Buscar tanques...",
"recent": "Visto recientemente",
"select_all": "Seleccionar todo",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "Por %s1 ❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "¡Por favor ayuda a traducir %s1 a %s2!",
"seo_description": "Herramientas para todo lo que es World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "Tankopedia",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "Características",
"compare": {
"label": "Comparar",
"label": "Comparar con",
"class": "Nivel %s1 - %s2",
"tier": "Todos de nivel %s1",
"all": "Todos los tanques"
+21 -33
View File
@@ -129,9 +129,9 @@
"asia": "Asie-Pacifique"
},
"short": {
"com": "Amérique du Nord",
"com": "NA",
"eu": "Europe",
"asia": "Asie-Pacifique"
"asia": "APAC"
}
},
"leagues": {
@@ -350,7 +350,7 @@
}
},
"body": {
"subtitle": "Recherche",
"subtitle": "Research",
"total": "Total",
"research": "Recherche: %s1",
"upgrades": "Améliorations : %s1",
@@ -377,7 +377,7 @@
"body": "# Commandes\n\nBlitzKit offre les commandes suivantes :\n\n"
},
"embeds": {
"name": "intègre",
"name": "embeds",
"description": "How embeds work"
},
"introduction": {
@@ -457,7 +457,7 @@
"body": {
"cards": {
"games": {
"title": "Parties",
"title": "Games",
"winrate": "Taux de victoires",
"battles": "Batailles",
"wins_losses": "Victoires/Défaites"
@@ -505,45 +505,45 @@
"description": "Search clans",
"options": {
"limit": {
"name": "limite",
"name": "limit",
"description": "The max number of clan results (default: %s1)"
}
},
"body": {
"title": "Clan search for %s1 in region %s2",
"no_results": "Pas de clan trouvé"
"no_results": "No clans found"
}
},
"search_players": {
"name": "recherche de joueur",
"description": "Recherche des joueurs",
"name": "search-players",
"description": "Search players",
"options": {
"limit": {
"name": "limite",
"description": "Le nombre maximum de résultats de joueur (par défaut: %s1)"
"name": "limit",
"description": "The max number of player results (default: %s1)"
}
},
"body": {
"title": "Recherche de %s1 dans la région %s2",
"no_results": "Pas de joueur de trouvé"
"title": "Player search for %s1 in region %s2",
"no_results": "No players found"
}
},
"rating_leaderboard": {
"name": "Classement de côté",
"description": "Statistiques des batailles de cotés",
"name": "rating-leaderboard",
"description": "Rating battles statistics",
"subcommands": {
"neighbors": {
"name": "neighbors",
"description": "Neighboring players on the leaderboard"
},
"league": {
"name": "ligue",
"name": "league",
"description": "Top players of a league"
}
},
"options": {
"limit": {
"name": "limite",
"name": "limit",
"description": "How many neighbors to display (default: %s1)"
},
"season": {
@@ -554,7 +554,7 @@
}
},
"league": {
"name": "ligue",
"name": "league",
"description": "The league to display"
}
},
@@ -572,7 +572,7 @@
"description": "Today's played tanks and statistics"
},
"stats": {
"name": "statistiques",
"name": "stats",
"description": "Quick statistics for a period"
},
"owned_tanks": {
@@ -665,7 +665,6 @@
"copied": "Copied!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "Search tanks...",
"recent": "Recently viewed",
"select_all": "Select all",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "By %s1 ❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "Please help translate %s1 to %s2!",
"seo_description": "Tools for everything World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "Tankopedia",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "Characteristics",
"compare": {
"label": "Compare",
"label": "Compare against",
"class": "Tier %s1 %s2",
"tier": "All of tier %s1",
"all": "All tanks"
@@ -1104,7 +1092,7 @@
"lookup": "Look up a player to get started",
"hint": "Search players...",
"searching": "Searching...",
"no_results": "Pas de joueur de trouvé"
"no_results": "No players found"
},
"controls": {
"title": "Tracking %s1",
+1 -13
View File
@@ -665,7 +665,6 @@
"copied": "コピーしました!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "車輌名を入力…",
"recent": "最近の閲覧",
"select_all": "全て選択",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "By %s1 ❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "%s1の %s2への翻訳にご協力ください!",
"seo_description": "Tools for everything World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "Tankopedia",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "性能値",
"compare": {
"label": "性能比較",
"label": "比較対象",
"class": "Tier %s1 %s2",
"tier": "Tier %s1 全車輌",
"all": "全車輌"
+1 -13
View File
@@ -665,7 +665,6 @@
"copied": "Copied!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "Search tanks...",
"recent": "Recently viewed",
"select_all": "Select all",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "By %s1 ❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "Please help translate %s1 to %s2!",
"seo_description": "Tools for everything World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "Tankopedia",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "Characteristics",
"compare": {
"label": "Compare",
"label": "Compare against",
"class": "Tier %s1 %s2",
"tier": "All of tier %s1",
"all": "All tanks"
+1 -13
View File
@@ -665,7 +665,6 @@
"copied": "Copiado!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "Procurar tanques...",
"recent": "Visto recentemente",
"select_all": "Selecionar todos",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "Por %s1 ❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "Por favor, ajude a traduzir %s1 para %s2!",
"seo_description": "Ferramentas para tudo World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "Tanquepedia",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "Características",
"compare": {
"label": "Comparar",
"label": "Comparar com",
"class": "Nível %s1 %s2",
"tier": "Tudo de nível %s1",
"all": "Todos os tanques"
+3 -15
View File
@@ -36,7 +36,7 @@
"local": "dev",
"dev": "бета",
"opentest": "открытый тест",
"preview": "превью"
"preview": "предварительный просмотр"
},
"locales": {
"en": "Английский",
@@ -665,7 +665,6 @@
"copied": "Скопировано!"
},
"tank_search": {
"clear_filters": "Сбросить фильтры",
"search_bar_hint": "Поиск танков...",
"recent": "Недавние",
"select_all": "Выбрать всё",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Присоединяйтесь к крутым ребятам!",
"join_long": "Присоединяйся к супер-дупер крутым ребятам!",
"action": "Discord"
},
"hero": {
"credit": "От %s1 ❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "Пожалуйста, помогите перевести %s1 на %s2!",
"seo_description": "Инструменты для World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "Списки изменений BlitzKit",
"seo_description": "Список изменений для бота Discord и сайта BlitzKit"
}
},
"tools": {
"tankopedia": {
"name": "Танкопедия",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "Характеристики",
"compare": {
"label": "Сравнение",
"label": "Сравнивать с",
"class": "%s2 %s1 уровня",
"tier": "Все %s1 уровня",
"all": "Все танки"
@@ -1143,7 +1131,7 @@
"description": "Встраиваемые элементы для стримов",
"seo_description": "Создать вставки для стримов по World of Tanks Blitz с невероятной кастомизации",
"coming_soon": "Скоро появятся новые встраиваемые элементы.",
"suggest": "Предложить идеи",
"suggest": "Предложить идеи.",
"preview": {
"title": "Предпросмотр",
"upload": "Загрузить фон для теста"
+11 -23
View File
@@ -9,8 +9,8 @@
"m": "%s1м",
"mm": "%s1мм",
"deg": "%s1°",
"hp": "%s1хп",
"x": "х%s1"
"hp": "%s1hp",
"x": "x%s1"
},
"gun_types": {
"auto_loader": "Магазинна система заряджання",
@@ -184,11 +184,11 @@
"common": {
"errors": {
"clan_not_found": "# Не вдалося знайти клан\nНе вдалося знайти клан \"%s1\". Спробуйте вибрати клан з пошукового результату.",
"player_not_found": "# Не вдалося знайти користувача\nЯ не зміг знайти користувача \"%s1\". Спробуйте вибрати користувача з результату пошуку, ввести коректний нікнейм, або використати команду '/link'.",
"player_not_linked": "# Використайте команду \"/link\" щоб почати\nЯ не знаю, хто ви, але ви можете сказати мені сьогодні!",
"tank_name_not_found": "# Танк не знайдено\nНе вдалось знайти танк за ім'ям \"%s1\".",
"tank_id_not_found": "# Танк не знайдено\nНе вдалось знайти танк за ID \"%s1\". Спробуйте ввести назву танка замість числа.",
"no_tank_stats": "# Немає статистики для танка\nЦей гравець не має статистики.\nМожливо, це не той гравець, якого ви шукаєте.",
"player_not_found": "# Could not find user\nI couldn't find user \"%s1\". Try picking an user from the search result, typing in a valid username, or using the `/link` command.",
"player_not_linked": "# Use `/link` to get started\nI don't know who you are but you can tell me today!",
"tank_name_not_found": "# Tank not found\nCould not find tank by the name \"%s1\".",
"tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"%s1\". Try typing the name of the tank instead of a number.",
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
"get_help": "Допомогти Discord серверу",
"uncaught_error": "# Упс! BlitzKit зіткнувся з помилкою!\nНам дуже шкода. Можете попросити допомоги на [офіційному сервері Discord](https://discord.gg/nDt7AjGJQH).",
"preview": "# Ця команда є в попередньому перегляді\n\nВи можете отримати доступ лише до цієї команди на [офіційному сервері Discord](https://discord.gg/nDt7AjGJQH). Команда в цілому буде доступна найближчим часом.",
@@ -399,8 +399,8 @@
}
},
"breakdown": {
"name": "аналіз",
"description": "Аналіз періоду за зіграними танками",
"name": "breakdown",
"description": "A period's breakdown by tanks played",
"body": {
"total": "Загалом",
"battles": "Бої",
@@ -511,7 +511,7 @@
},
"body": {
"title": "Clan search for %s1 in region %s2",
"no_results": "Жодного клану не знайдено"
"no_results": "No clans found"
}
},
"search_players": {
@@ -665,7 +665,6 @@
"copied": "Скопійовано!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "Шукайте техніку...",
"recent": "Недавно переглянуті",
"select_all": "Вибрати все",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "Зроблено %s1 ❤"
},
@@ -750,12 +744,6 @@
"help_translate": "Будь ласка, допоможіть перекласти %s1 на %s2!",
"seo_description": "Інструменти для всього, пов'язаного з WoT Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "Танкопедія",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "Characteristics",
"compare": {
"label": "Порівняти",
"label": "Compare against",
"class": "Tier %s1 %s2",
"tier": "All of tier %s1",
"all": "Усі танки"
+1 -13
View File
@@ -665,7 +665,6 @@
"copied": "已複製!"
},
"tank_search": {
"clear_filters": "Clear filters",
"search_bar_hint": "搜尋戰車....",
"recent": "最近查看",
"select_all": "選擇全部",
@@ -732,11 +731,6 @@
}
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "由 %s1 製作❤️"
},
@@ -750,12 +744,6 @@
"help_translate": "請幫忙將 %s1 翻譯成 %s2!",
"seo_description": "戰車世界閃擊戰 全方位工具"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"name": "戰車百科",
@@ -900,7 +888,7 @@
"characteristics": {
"title": "属性",
"compare": {
"label": "比較",
"label": "比较",
"class": "%s1 %s2 级",
"tier": "所有级别 %s1",
"all": "所有坦克"
@@ -1,26 +1,26 @@
import { createDefaultSkills } from '@blitzkit/core';
import { Flex, Heading, Text } from '@radix-ui/themes';
import { useEffect, useMemo, useState } from 'react';
import { CompareTable } from '../../../components/Compare/CompareTable';
import { Controls } from '../../../components/Compare/Controls';
import { DamageWarning } from '../../../components/DamageWarning';
import { PageWrapper } from '../../../components/PageWrapper';
import { awaitableEquipmentDefinitions } from '../../../core/awaitables/equipmentDefinitions';
import { awaitableModelDefinitions } from '../../../core/awaitables/modelDefinitions';
import { awaitableProvisionDefinitions } from '../../../core/awaitables/provisionDefinitions';
import { awaitableSkillDefinitions } from '../../../core/awaitables/skillDefinitions';
import { awaitableTankDefinitions } from '../../../core/awaitables/tankDefinitions';
import { tankCharacteristics } from '../../../core/blitzkit/tankCharacteristics';
import { tankToCompareMember } from '../../../core/blitzkit/tankToCompareMember';
import { CompareTable } from '../../../../components/Compare/CompareTable';
import { Controls } from '../../../../components/Compare/Controls';
import { DamageWarning } from '../../../../components/DamageWarning';
import { PageWrapper } from '../../../../components/PageWrapper';
import { awaitableEquipmentDefinitions } from '../../../../core/awaitables/equipmentDefinitions';
import { awaitableModelDefinitions } from '../../../../core/awaitables/modelDefinitions';
import { awaitableProvisionDefinitions } from '../../../../core/awaitables/provisionDefinitions';
import { awaitableSkillDefinitions } from '../../../../core/awaitables/skillDefinitions';
import { awaitableTankDefinitions } from '../../../../core/awaitables/tankDefinitions';
import { tankCharacteristics } from '../../../../core/blitzkit/tankCharacteristics';
import { tankToCompareMember } from '../../../../core/blitzkit/tankToCompareMember';
import {
type LocaleAcceptorProps,
LocaleProvider,
useLocale,
} from '../../../hooks/useLocale';
import { App } from '../../../stores/app';
import { CompareEphemeral } from '../../../stores/compareEphemeral';
import { ComparePersistent } from '../../../stores/comparePersistent';
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
type LocaleAcceptorProps,
} from '../../../../hooks/useLocale';
import { App } from '../../../../stores/app';
import { CompareEphemeral } from '../../../../stores/compareEphemeral';
import { ComparePersistent } from '../../../../stores/comparePersistent';
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
const [
modelDefinitions,
@@ -113,11 +113,7 @@ function Content() {
if (tank === undefined) return;
const model = modelDefinitions.models[tank.id];
draft.members.push(
tankToCompareMember(tank, model, provisionDefinitions),
);
draft.members.push(tankToCompareMember(tank, provisionDefinitions));
});
});
}, []);
@@ -0,0 +1,16 @@
---
import ToolOpenGraph from '../../../../components/ToolOpenGraph.astro';
import { compareTool } from '../../../../constants/tools';
import BaseLayout from '../../../../layouts/BaseLayout.astro';
import { Page } from './_index';
export { getStaticPaths } from '../../index.astro';
const { locale } = Astro.params;
---
<ToolOpenGraph tool={compareTool} />
<BaseLayout noFooter>
<Page {locale} client:load />
</BaseLayout>
@@ -8,33 +8,33 @@ import {
} from '@radix-ui/react-icons';
import { Box, Button, Flex, Heading, ScrollArea, Text } from '@radix-ui/themes';
import { useEffect, useRef, useState, type ReactNode } from 'react';
import { CopyButton } from '../../../../components/CopyButton';
import { Boolean } from '../../../../components/Embeds/Boolean';
import { Color } from '../../../../components/Embeds/Color';
import { Enum } from '../../../../components/Embeds/Enum';
import { GenerateURL } from '../../../../components/Embeds/GenerateURL';
import { Import } from '../../../../components/Embeds/Import';
import { PreviewWrapper } from '../../../../components/Embeds/PreviewWrapper';
import { Radius } from '../../../../components/Embeds/Radius';
import { RichText } from '../../../../components/Embeds/RichText';
import { Size } from '../../../../components/Embeds/Size';
import { SizeWithout0 } from '../../../../components/Embeds/SizeWithout0';
import { Slider } from '../../../../components/Embeds/Slider';
import { TextController } from '../../../../components/Embeds/TextController';
import { PageWrapper } from '../../../../components/PageWrapper';
import { CopyButton } from '../../../../../components/CopyButton';
import { Boolean } from '../../../../../components/Embeds/Boolean';
import { Color } from '../../../../../components/Embeds/Color';
import { Enum } from '../../../../../components/Embeds/Enum';
import { GenerateURL } from '../../../../../components/Embeds/GenerateURL';
import { Import } from '../../../../../components/Embeds/Import';
import { PreviewWrapper } from '../../../../../components/Embeds/PreviewWrapper';
import { Radius } from '../../../../../components/Embeds/Radius';
import { RichText } from '../../../../../components/Embeds/RichText';
import { Size } from '../../../../../components/Embeds/Size';
import { SizeWithout0 } from '../../../../../components/Embeds/SizeWithout0';
import { Slider } from '../../../../../components/Embeds/Slider';
import { TextController } from '../../../../../components/Embeds/TextController';
import { PageWrapper } from '../../../../../components/PageWrapper';
import {
embedConfigurations,
extractEmbedConfigDefaults,
} from '../../../../constants/embeds';
import { NAVBAR_HEIGHT } from '../../../../constants/navbar';
} from '../../../../../constants/embeds';
import { NAVBAR_HEIGHT } from '../../../../../constants/navbar';
import {
LocaleProvider,
useLocale,
type LocaleAcceptorProps,
} from '../../../../hooks/useLocale';
import { App } from '../../../../stores/app';
import { EmbedState, type EmbedConfig } from '../../../../stores/embedState';
import { EmbedItemType } from '../../../../stores/embedState/constants';
} from '../../../../../hooks/useLocale';
import { App } from '../../../../../stores/app';
import { EmbedState, type EmbedConfig } from '../../../../../stores/embedState';
import { EmbedItemType } from '../../../../../stores/embedState/constants';
export interface EmbedPreviewControllerProps {
configKey: string;
@@ -1,28 +1,24 @@
import { Box } from '@radix-ui/themes';
import { useMemo } from 'react';
import { parse } from 'urlon';
import { BlitzKitTheme } from '../../../../../components/BlitzKitTheme';
import { BlitzKitTheme } from '../../../../../../components/BlitzKitTheme';
import {
embedConfigurations,
embedRenderers,
extractEmbedConfigDefaults,
} from '../../../../../constants/embeds';
import {
LocaleProvider,
type LocaleAcceptorProps,
} from '../../../../../hooks/useLocale';
} from '../../../../../../constants/embeds';
import {
EmbedState,
type EmbedConfig,
type ExtractEmbedConfigTypes,
} from '../../../../../stores/embedState';
import { useEmbedStateCurry } from '../../../../../stores/embedState/utilities';
} from '../../../../../../stores/embedState';
import { useEmbedStateCurry } from '../../../../../../stores/embedState/utilities';
interface PageProps {
embed: keyof typeof embedConfigurations;
}
export function Page({ embed, locale }: PageProps & LocaleAcceptorProps) {
export function Page({ embed }: PageProps) {
const state = useMemo(() => {
const params = new URLSearchParams(window.location.search);
const stateRaw = params.get('state');
@@ -36,11 +32,9 @@ export function Page({ embed, locale }: PageProps & LocaleAcceptorProps) {
}, [embed]);
return (
<LocaleProvider locale={locale}>
<EmbedState.Provider data={state}>
<Content embed={embed} />
</EmbedState.Provider>
</LocaleProvider>
<EmbedState.Provider data={state}>
<Content embed={embed} />
</EmbedState.Provider>
);
}
@@ -1,13 +1,11 @@
---
import EmbedLayout from '../../../../../layouts/EmbedLayout.astro';
import EmbedLayout from '../../../../../../layouts/EmbedLayout.astro';
import type { getStaticPaths } from '../index.astro';
import { Page } from './_index';
export { getStaticPaths } from '../index.astro';
const { locale } = Astro.params;
---
<EmbedLayout>
<Page {locale} client:only="react" embed={Astro.params.embed} />
<Page client:only="react" embed={Astro.params.embed} />
</EmbedLayout>
@@ -2,8 +2,8 @@
import { AstroSeo } from '@astrolib/seo';
import type { GetStaticPaths } from 'astro';
import { capitalize } from 'lodash-es';
import { embedConfigurations } from '../../../../constants/embeds';
import BaseLayout from '../../../../layouts/BaseLayout.astro';
import { embedConfigurations } from '../../../../../constants/embeds';
import BaseLayout from '../../../../../layouts/BaseLayout.astro';
import { getStaticPaths as parentGetStaticPaths } from '../index.astro';
import { Page } from './_index';
Loaded 100 of 371 files, more files were not shown because too many files have changed in this diff. Show more