mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
feat; define vehicles mock data for tree
This commit is contained in:
1 parent
7b57ee9c80
commit
8999a1e005
7 files changed
+148
-76
No files matched your search
@@ -6,6 +6,8 @@ using Bogus;
|
||||
using Bogus.Extensions;
|
||||
using WotBlitzStatisticsPro.Blazor.GraphQl;
|
||||
using WotBlitzStatisticsPro.Blazor.Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Services.Mock
|
||||
{
|
||||
@@ -106,6 +108,7 @@ namespace WotBlitzStatisticsPro.Blazor.Services.Mock
|
||||
);
|
||||
}
|
||||
|
||||
var jObject = JObject.Parse(VehiclesMockData.TanksList);
|
||||
var tanks = new List<IPlayer_AccountInfo_Tanks>();
|
||||
for (int i = 0; i < tanksCount; i++)
|
||||
{
|
||||
@@ -151,6 +154,50 @@ namespace WotBlitzStatisticsPro.Blazor.Services.Mock
|
||||
faker.Random.Decimal(5M, 95M)
|
||||
));
|
||||
}
|
||||
// for (int i = 0; i < tanksCount; i++)
|
||||
// {
|
||||
// var nation = GetRandomNation(faker, GetLanguage());
|
||||
// var vehicleType = GetRandomVehicleType(faker, GetLanguage());
|
||||
// tanks.Add(new Player_AccountInfo_Tanks_TankInfoResponse(
|
||||
// faker.Random.Long(100000, 999999),
|
||||
// faker.Random.Number(500),
|
||||
// faker.PickRandom<MarkOfMastery>(),
|
||||
// faker.Random.Decimal(0M, 7M),
|
||||
// faker.Name.LastName(),
|
||||
// nation.nation,
|
||||
// nation.nationName,
|
||||
// faker.Random.Number(1, 10),
|
||||
// vehicleType.vehicleType,
|
||||
// vehicleType.vehicleTypeName,
|
||||
// faker.Random.Bool(),
|
||||
// GetRandomPreviewImage(faker),
|
||||
// GetRandomLargeImage(faker),
|
||||
// faker.Date.Past(),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Long(1, 9999),
|
||||
// faker.Random.Double(500D, 2000D),
|
||||
// faker.Random.Decimal(20M, 95M),
|
||||
// faker.Random.Decimal(300M, 4000M),
|
||||
// faker.Random.Decimal(100M, 2000M),
|
||||
// faker.Random.Decimal(0M, 3M),
|
||||
// faker.Random.Decimal(5M, 95M)
|
||||
// ));
|
||||
// }
|
||||
|
||||
if (_needToWait)
|
||||
{
|
||||
@@ -408,9 +455,28 @@ namespace WotBlitzStatisticsPro.Blazor.Services.Mock
|
||||
{
|
||||
return Task.FromResult("Fake logout");
|
||||
}
|
||||
public async Task<IReadOnlyList<IDictionary_Vehicles>> GetVehiclesByNation(string nationId)
|
||||
public Task<IReadOnlyList<IDictionary_Vehicles>> GetVehiclesByNation(string nationId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var jObject = JObject.Parse(VehiclesMockData.VehiclesDictionary);
|
||||
var result = new List<IDictionary_Vehicles>();
|
||||
// foreach (var vehicleObject in jObject)
|
||||
// {
|
||||
// result.Add(new Dictionary_Vehicles_VehicleResponse(
|
||||
// vehicleObject["tankid"].Value<long>(),
|
||||
// vehicleObject["name"].Value<string>(),
|
||||
// vehicleObject["description"].Value<string>(),
|
||||
// vehicleObject["isPremium"].Value<bool>(),
|
||||
// vehicleObject["typeId"].Value<string>(),
|
||||
// vehicleObject["nationId"].Value<string>(),
|
||||
// vehicleObject["tier"].Value<int>(),
|
||||
// vehicleObject["previewImage"].Value<string>(),
|
||||
// vehicleObject["normalImage"].Value<string>(),
|
||||
// vehicleObject["priceCredit"].Value<decimal>(),
|
||||
// vehicleObject["priceGold"].Value<decimal>(),
|
||||
// vehicleObject["nexTanksInTree"].Value<List<long>>()
|
||||
// ));
|
||||
// }
|
||||
return Task.FromResult((IReadOnlyList<IDictionary_Vehicles>)result.AsReadOnly());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace WotBlitzStatisticsPro.Blazor.Services.Mock
|
||||
{
|
||||
public static class VehiclesMockData
|
||||
{
|
||||
public static string VehiclesDictionary = @"[{""TankId"":16401,""Name"":""Waffentr\u00E4ger auf Pz. IV"",""Description"":""Tank destroyer developed in February 1944 on the basis of the PzIV tank. Development was discontinued in favor of a similar vehicle on the basis of the Krupp Waffentrager 12.8 cm PaK 44 of Czech origin. Existed only in blueprints."",""IsPremium"":false,""TypeId"":""AT-SPG"",""NationId"":""germany"",""Tier"":9,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/Waffentrager_IV.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/Waffentrager_IV.png"",""PriceCredit"":3400000,""PriceGold"":0,""NexTanksInTree"":[19217]},{""TankId"":1297,""Name"":""Panther I"",""Description"":""This famous tank was produced from January 1943 through April 1945, with a total of 5,796 vehicles built plus eight vehicles built on the F series chassis."",""IsPremium"":false,""TypeId"":""mediumTank"",""NationId"":""germany"",""Tier"":7,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/PzV.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/PzV.png"",""PriceCredit"":1380000,""PriceGold"":0,""NexTanksInTree"":[5137,8465]},{""TankId"":52497,""Name"":""Pz.Kpfw. 38H 735 (f)"",""Description"":""In May 1940 the French Army had more than 800 vehicles of this type, most of which were captured by the German forces. They were widely used by the Wehrmacht to supplement existing armor."",""IsPremium"":true,""TypeId"":""lightTank"",""NationId"":""germany"",""Tier"":2,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/H39_captured.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/H39_captured.png"",""PriceCredit"":0,""PriceGold"":750,""NexTanksInTree"":[]},{""TankId"":18961,""Name"":""Sp\u00E4hpanzer SP I C"",""Description"":""The reconnaissance tank destroyer was being developed by Hotchkiss and Kl\u00F6ckner-Humboldt-Deutz companies from 1956 through 1962 in order to increase the anti-tank capability of recon tank battalions. A 90-mm anti-tank gun was planned to be mounted on the new vehicle. The project was eventually declined. The number of prototypes built is unknown."",""IsPremium"":false,""TypeId"":""lightTank"",""NationId"":""germany"",""Tier"":7,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/G113_SP_I_C.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/G113_SP_I_C.png"",""PriceCredit"":1360000,""PriceGold"":0,""NexTanksInTree"":[13841,18449]},{""TankId"":52241,""Name"":""Pz.Kpfw. B2 740 (f)"",""Description"":""During the European campaign, German troops captured 161 heavy B1 bis tanks that later received the Pz.Kpfw. B2 740 (f) designation. All vehicles were upgraded and received German radio equipment and twofold hatches on commander\u0027s cupolas. Some vehicles with dismantled armament were used for training purposes, and 16 vehicles were transformed into self-propelled howitzers. Most vehicles were converted into flame throwing tanks."",""IsPremium"":true,""TypeId"":""heavyTank"",""NationId"":""germany"",""Tier"":4,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/B-1bis_captured.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/B-1bis_captured.png"",""PriceCredit"":0,""PriceGold"":1500,""NexTanksInTree"":[]},{""TankId"":7185,""Name"":""VK 30.01 (P)"",""Description"":""The Porsche company developed the concept of a new vehicle in 1939. On March 5, 1941, after numerous approvals, the company prepared blueprints and, in July 1941, produced the hull from mild steel. The hull and chassis (with detachable equipment for trenching) passed performance trials. One wooden prototype of the turret and one wooden prototype of the hull were manufactured. In 1942, the project was discontinued in favor of new heavy tanks."",""IsPremium"":false,""TypeId"":""mediumTank"",""NationId"":""germany"",""Tier"":6,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/VK3001P.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/VK3001P.png"",""PriceCredit"":920000,""PriceGold"":0,""NexTanksInTree"":[10769]},{""TankId"":19985,""Name"":""Skorpion G"",""Description"":""Development of the second series of self-propelled guns on the basis of the Panther tank was started by the Rheinmetall company in January 1943. The design plans for the 12,8 cm Skorpion were completed on April 2, 1943. Existed only in blueprints."",""IsPremium"":true,""TypeId"":""AT-SPG"",""NationId"":""germany"",""Tier"":8,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/c
Line truncated
|
||||
|
||||
public static string TanksList = @"[{""TankId"":9297,""BattleLifeTimeInSeconds"":1022,""MarkOfMastery"":2,""AvgBattleLifeTimeInMinutes"":2.4333333333333333333333333333,""Name"":""FV215b (183)"",""TankNationId"":""uk"",""TankNation"":""U.K."",""Tier"":10,""TankTypeId"":""AT-SPG"",""TankType"":""Tank Destroyer"",""IsPremium"":false,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/GB48_FV215b_183.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/GB48_FV215b_183.png""},{""TankId"":9217,""BattleLifeTimeInSeconds"":79623,""MarkOfMastery"":4,""AvgBattleLifeTimeInMinutes"":2.8416488222698072805139186296,""Name"":""IS-6"",""TankNationId"":""ussr"",""TankNation"":""U.S.S.R."",""Tier"":8,""TankTypeId"":""heavyTank"",""TankType"":""Heavy Tank"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/Object252.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/Object252.png""},{""TankId"":59905,""BattleLifeTimeInSeconds"":134227,""MarkOfMastery"":4,""AvgBattleLifeTimeInMinutes"":2.6695902943516308671439936356,""Name"":""T-54 first prototype"",""TankNationId"":""ussr"",""TankNation"":""U.S.S.R."",""Tier"":8,""TankTypeId"":""mediumTank"",""TankType"":""Medium Tank"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/R112_T54_45.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/R112_T54_45.png""},{""TankId"":13345,""BattleLifeTimeInSeconds"":112711,""MarkOfMastery"":4,""AvgBattleLifeTimeInMinutes"":2.5419711321605773567884528642,""Name"":""T26E4 SuperPershing"",""TankNationId"":""usa"",""TankNation"":""U.S.A."",""Tier"":8,""TankTypeId"":""mediumTank"",""TankType"":""Medium Tank"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/T26_E4_SuperPershing.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/T26_E4_SuperPershing.png""},{""TankId"":23569,""BattleLifeTimeInSeconds"":93,""MarkOfMastery"":0,""AvgBattleLifeTimeInMinutes"":1.55,""Name"":""Pz. IV Gargoyle"",""TankNationId"":""germany"",""TankNation"":""Germany"",""Tier"":5,""TankTypeId"":""mediumTank"",""TankType"":""Medium Tank"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/Pz_IV_AusfBT.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/Pz_IV_AusfBT.png""},{""TankId"":15953,""BattleLifeTimeInSeconds"":8400,""MarkOfMastery"":3,""AvgBattleLifeTimeInMinutes"":2.3728813559322033898305084746,""Name"":""FV201 (A45)"",""TankNationId"":""uk"",""TankNation"":""U.K."",""Tier"":7,""TankTypeId"":""heavyTank"",""TankType"":""Heavy Tank"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/GB52_FV201_A45.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/GB52_FV201_A45.png""},{""TankId"":59649,""BattleLifeTimeInSeconds"":27832,""MarkOfMastery"":4,""AvgBattleLifeTimeInMinutes"":2.3427609427609427609427609428,""Name"":""ISU-122S"",""TankNationId"":""ussr"",""TankNation"":""U.S.S.R."",""Tier"":7,""TankTypeId"":""AT-SPG"",""TankType"":""Tank Destroyer"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/R116_ISU122C_Berlin.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/R116_ISU122C_Berlin.png""},{""TankId"":55297,""BattleLifeTimeInSeconds"":7997,""MarkOfMastery"":3,""AvgBattleLifeTimeInMinutes"":2.1156084656084656084656084656,""Name"":""SU-122-44"",""TankNationId"":""ussr"",""TankNation"":""U.S.S.R."",""Tier"":7,""TankTypeId"":""AT-SPG"",""TankType"":""Tank Destroyer"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/SU122_44.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/SU122_44.png""},{""TankId"":64001,""BattleLifeTimeInSeconds"":7409,""MarkOfMastery"":2,""AvgBattleLifeTimeInMinutes"":1.9916666666666666666666666667,""Name"":""T-34-85 Rudy"",""TankNationId"":""ussr"",""TankNation"":""U.S.S.R."",""Tier"":7,""TankTypeId"":""mediumTank"",""TankType"":""Medium Tank"",""IsPremium"":true,""PreviewImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd_thumbnail/T-34-85_Rudy.png"",""NormalImage"":""http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/T-34-85_Rudy.png""},{""TankId"":62993,""BattleLifeTimeInSeconds"":71894,""MarkOfMastery"":4,""AvgBattleLifeTimeInMinutes"":2.8665869218500797448165869219,""Name"":""VK
Line truncated
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user