Remove unnecessary code

This commit is contained in:
Dev 2023-08-13 18:59:22 +01:00
parent 20fd8d98c4
commit 3b99fc190b
3 changed files with 3 additions and 20 deletions

View File

@ -117,8 +117,7 @@ public class LootDumpProcessorContext
{
_tarkovItems = new TarkovItems(
$"{GetConfig().ServerLocation}/project/assets/database/templates/items.json",
$"{GetConfig().ServerLocation}/project/assets/database/templates/handbook.json",
$"{GetConfig().ServerLocation}/project/assets/database/locations/tarkovstreets/statics.json"
$"{GetConfig().ServerLocation}/project/assets/database/templates/handbook.json"
);
}
}

View File

@ -144,16 +144,7 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor
}
private static double GetStaticProbability(string mapName, KeyValuePair<Template, int> td, Dictionary<string, int> mapDumpCounter)
{
if (mapName == "Streets of Tarkov")
{
var result = LootDumpProcessorContext.GetTarkovItems().GetProbabilityByContainerId(td.Key.Id);
if (result != null)
{
return Math.Round((double)(result.probability), 2);
}
}
{
return Math.Round((double)((decimal)td.Value / (decimal)mapDumpCounter[mapName]), 2);
}

View File

@ -9,13 +9,11 @@ public class TarkovItems
private Dictionary<string, TemplateFileItem> _items;
private HandbookRoot _handbook;
private List<StaticContainerRoot> _streetsStatics;
public TarkovItems(string items, string handbook, string streetsStatics)
public TarkovItems(string items, string handbook)
{
_items = _jsonSerializer.Deserialize<Dictionary<string, TemplateFileItem>>(File.ReadAllText(items));
_handbook = _jsonSerializer.Deserialize<HandbookRoot>(File.ReadAllText(handbook));
_streetsStatics = _jsonSerializer.Deserialize<List<StaticContainerRoot>>(File.ReadAllText(streetsStatics));
}
public virtual bool IsBaseClass(string tpl, string baseclass_id)
@ -44,9 +42,4 @@ public class TarkovItems
var item_template = _items[tpl];
return item_template.Props.Caliber;
}
public virtual StaticContainerRoot GetProbabilityByContainerId(string id)
{
return _streetsStatics.FirstOrDefault(x => x.template.Id == id);
}
}