0
0
mirror of https://github.com/sp-tarkov/loot-dump-processor.git synced 2025-02-12 22:50:45 -05:00

Refactored model classes to use records and improved immutability

This commit is contained in:
bluextx 2025-01-11 12:15:01 +03:00
parent 9e9933bd32
commit 12746997e7
44 changed files with 263 additions and 652 deletions

View File

@ -3,12 +3,4 @@ using System.Text.Json.Serialization;
namespace LootDumpProcessor.Model;
public class FireMode : ICloneable
{
[JsonPropertyName("FireMode")] public string? FireModeType { get; set; }
public object Clone() => new FireMode
{
FireModeType = FireModeType
};
}
public readonly record struct FireMode([property: JsonPropertyName("FireMode")] string FireModeType);

View File

@ -1,11 +1,3 @@
namespace LootDumpProcessor.Model;
public class Foldable : ICloneable
{
public bool? Folded { get; set; }
public object Clone() => new Foldable
{
Folded = Folded
};
}
public readonly record struct Foldable(bool Folded);

View File

@ -1,26 +1,17 @@
using LootDumpProcessor.Utils;
namespace LootDumpProcessor.Model;
public class GroupPosition : ICloneable
{
public string? Name { get; set; }
public int? Weight { get; set; }
public Vector3? Position { get; set; }
public Vector3? Rotation { get; set; }
public string Name { get; set; }
public int Weight { get; set; }
public Vector3 Position { get; set; }
public Vector3 Rotation { get; set; }
public object Clone() => new GroupPosition
{
Name = Name,
Weight = Weight,
Position = ProcessorUtil.Copy(Position),
Rotation = ProcessorUtil.Copy(Rotation)
Position = Position,
Rotation = Rotation
};
}

View File

@ -1,16 +1,15 @@
namespace LootDumpProcessor.Model.Input;
public class AdditionalHostilitySetting
{
public string? BotRole { get; set; }
public List<string>? AlwaysEnemies { get; set; }
public List<ChancedEnemy>? ChancedEnemies { get; set; }
public List<string>? Warn { get; set; }
public List<string>? Neutral { get; set; }
public List<string>? AlwaysFriends { get; set; }
public string? SavagePlayerBehaviour { get; set; }
public string? BearPlayerBehaviour { get; set; }
public int? BearEnemyChance { get; set; }
public string? UsecPlayerBehaviour { get; set; }
public int? UsecEnemyChance { get; set; }
}
public readonly record struct AdditionalHostilitySetting(
string BotRole,
IReadOnlyList<string> AlwaysEnemies,
IReadOnlyList<ChancedEnemy> ChancedEnemies,
IReadOnlyList<string> Warn,
IReadOnlyList<string> Neutral,
IReadOnlyList<string> AlwaysFriends,
string SavagePlayerBehaviour,
string BearPlayerBehaviour,
int BearEnemyChance,
string UsecPlayerBehaviour,
int UsecEnemyChance
);

View File

@ -1,15 +1,14 @@
namespace LootDumpProcessor.Model.Input;
public class AirdropParameter
{
public int? PlaneAirdropStartMin { get; set; }
public int? PlaneAirdropStartMax { get; set; }
public int? PlaneAirdropEnd { get; set; }
public float? PlaneAirdropChance { get; set; }
public int? PlaneAirdropMax { get; set; }
public int? PlaneAirdropCooldownMin { get; set; }
public int? PlaneAirdropCooldownMax { get; set; }
public int? AirdropPointDeactivateDistance { get; set; }
public int? MinPlayersCountToSpawnAirdrop { get; set; }
public int? UnsuccessfulTryPenalty { get; set; }
}
public readonly record struct AirdropParameter(
int PlaneAirdropStartMin,
int PlaneAirdropStartMax,
int PlaneAirdropEnd,
float PlaneAirdropChance,
int PlaneAirdropMax,
int PlaneAirdropCooldownMin,
int PlaneAirdropCooldownMax,
int AirdropPointDeactivateDistance,
int MinPlayersCountToSpawnAirdrop,
int UnsuccessfulTryPenalty
);

View File

@ -1,20 +1,19 @@
namespace LootDumpProcessor.Model.Input;
public class BTRServerSettings
{
public float? ChanceSpawn { get; set; }
public Vector3? SpawnPeriod { get; set; }
public float? MoveSpeed { get; set; }
public float? ReadyToDepartureTime { get; set; }
public float? CheckTurnDistanceTime { get; set; }
public float? TurnCheckSensitivity { get; set; }
public float? DecreaseSpeedOnTurnLimit { get; set; }
public float? EndSplineDecelerationDistance { get; set; }
public float? AccelerationSpeed { get; set; }
public float? DecelerationSpeed { get; set; }
public Vector3? PauseDurationRange { get; set; }
public float? BodySwingReturnSpeed { get; set; }
public float? BodySwingDamping { get; set; }
public float? BodySwingIntensity { get; set; }
public ServerMapBTRSettings? ServerMapBTRSettings { get; set; }
}
public readonly record struct BTRServerSettings(
float ChanceSpawn,
Vector3 SpawnPeriod,
float MoveSpeed,
float ReadyToDepartureTime,
float CheckTurnDistanceTime,
float TurnCheckSensitivity,
float DecreaseSpeedOnTurnLimit,
float EndSplineDecelerationDistance,
float AccelerationSpeed,
float DecelerationSpeed,
Vector3 PauseDurationRange,
float BodySwingReturnSpeed,
float BodySwingDamping,
float BodySwingIntensity,
ServerMapBTRSettings ServerMapBTRSettings
);

View File

@ -1,7 +1,6 @@
namespace LootDumpProcessor.Model.Input;
public class Banner
{
public string? Id { get; set; }
public Pic? Pic { get; set; }
}
public readonly record struct Banner(
string Id,
Pic Pic
);

View File

@ -1,19 +1,18 @@
namespace LootDumpProcessor.Model.Input;
public class BotLocationModifier
{
public float? AccuracySpeed { get; set; }
public float? Scattering { get; set; }
public float? GainSight { get; set; }
public float? MarksmanAccuratyCoef { get; set; }
public float? VisibleDistance { get; set; }
public float? DistToPersueAxemanCoef { get; set; }
public int? KhorovodChance { get; set; }
public float? MinExfiltrationTime { get; set; }
public float? MaxExfiltrationTime { get; set; }
public float? DistToActivatePvE { get; set; }
public float? DistToSleepPvE { get; set; }
public float? DistToActivate { get; set; }
public float? DistToSleep { get; set; }
public List<AdditionalHostilitySetting>? AdditionalHostilitySettings { get; set; }
}
public readonly record struct BotLocationModifier(
float AccuracySpeed,
float Scattering,
float GainSight,
float MarksmanAccuratyCoef,
float VisibleDistance,
float DistToPersueAxemanCoef,
int KhorovodChance,
float MinExfiltrationTime,
float MaxExfiltrationTime,
float DistToActivatePvE,
float DistToSleepPvE,
float DistToActivate,
float DistToSleep,
IReadOnlyList<AdditionalHostilitySetting> AdditionalHostilitySettings
);

View File

@ -1,7 +1,6 @@
namespace LootDumpProcessor.Model.Input;
public class ChancedEnemy
{
public int? EnemyChance { get; set; }
public string? Role { get; set; }
}
public readonly record struct ChancedEnemy(
int EnemyChance,
string Role
);

View File

@ -1,7 +1,6 @@
namespace LootDumpProcessor.Model.Input;
public class ColliderParams
{
public string? Parent { get; set; }
public Props? Props { get; set; }
}
public readonly record struct ColliderParams(
string Parent,
Props Props
);

View File

@ -1,6 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class CompletedQuest
{
public string? QuestID { get; set; }
}
public readonly record struct CompletedQuest(string QuestId);

View File

@ -1,9 +1,8 @@
namespace LootDumpProcessor.Model.Input;
public class Data
{
public string? ServerID { get; set; }
public ServerSettings? ServerSettings { get; set; }
public object? Profile { get; set; }
public required LocationLoot LocationLoot { get; set; }
}
public readonly record struct Data(
string ServerId,
ServerSettings ServerSettings,
object Profile,
LocationLoot LocationLoot
);

View File

@ -1,25 +1,24 @@
namespace LootDumpProcessor.Model.Input;
public class Exit
{
public string? Name { get; set; }
public string? EntryPoints { get; set; }
public float? Chance { get; set; }
public int? MinTime { get; set; }
public int? MaxTime { get; set; }
public int? PlayersCount { get; set; }
public float? ExfiltrationTime { get; set; }
public string? PassageRequirement { get; set; }
public string? ExfiltrationType { get; set; }
public string? RequiredSlot { get; set; }
public string? Id { get; set; }
public string? RequirementTip { get; set; }
public int? Count { get; set; }
public bool? EventAvailable { get; set; }
public int? MinTimePVE { get; set; }
public int? MaxTimePVE { get; set; }
public float? ChancePVE { get; set; }
public int? CountPVE { get; set; }
public float? ExfiltrationTimePVE { get; set; }
public int? PlayersCountPVE { get; set; }
}
public readonly record struct Exit(
string Name,
string EntryPoints,
float Chance,
int MinTime,
int MaxTime,
int PlayersCount,
float ExfiltrationTime,
string PassageRequirement,
string ExfiltrationType,
string RequiredSlot,
string Id,
string RequirementTip,
int Count,
bool EventAvailable,
int MinTimePve,
int MaxTimePve,
float ChancePve,
int CountPve,
float ExfiltrationTimePve,
int PlayersCountPve
);

View File

@ -1,6 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class ItemCost
{
public int? Count { get; set; }
}
public readonly record struct ItemCost(int Count);

View File

@ -1,193 +1,100 @@
using System.Text.Json.Serialization;
namespace LootDumpProcessor.Model.Input;
public class LocationLoot
{
public bool? Enabled { get; set; }
public bool? EnableCoop { get; set; }
public bool? ForceOnlineRaidInPVE { get; set; }
public bool? Locked { get; set; }
public bool? Insurance { get; set; }
public bool? SafeLocation { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public Scene? Scene { get; set; }
public float? Area { get; set; }
public int? RequiredPlayerLevelMin { get; set; }
public int? RequiredPlayerLevelMax { get; set; }
public int? PmcMaxPlayersInGroup { get; set; }
public int? ScavMaxPlayersInGroup { get; set; }
public int? MinPlayers { get; set; }
public int? MaxPlayers { get; set; }
public int? MaxCoopGroup { get; set; }
public int? ExitCount { get; set; }
public int? ExitAccessTime { get; set; }
public int? ExitTime { get; set; }
public Preview? Preview { get; set; }
public int? IconX { get; set; }
public int? IconY { get; set; }
public List<object>? FilterEx { get; set; }
public List<object>? Waves { get; set; }
public List<object>? Limits { get; set; }
public int? AveragePlayTime { get; set; }
public int? AveragePlayerLevel { get; set; }
public int? EscapeTimeLimit { get; set; }
public int? EscapeTimeLimitPVE { get; set; }
public int? EscapeTimeLimitCoop { get; set; }
public string? Rules { get; set; }
public bool? IsSecret { get; set; }
public List<object>? Doors { get; set; }
[JsonPropertyName("tmp_location_field_remove_me")] public int? TmpLocationFieldRemoveMe { get; set; }
public int? MinDistToExitPoint { get; set; }
public int? MaxDistToFreePoint { get; set; }
public int? MinDistToFreePoint { get; set; }
public int? MaxBotPerZone { get; set; }
public string? OpenZones { get; set; }
public bool? OcculsionCullingEnabled { get; set; }
public float? GlobalLootChanceModifier { get; set; }
public float? GlobalLootChanceModifierPvE { get; set; }
public bool? OldSpawn { get; set; }
public bool? OfflineOldSpawn { get; set; }
public bool? NewSpawn { get; set; }
public bool? OfflineNewSpawn { get; set; }
public int? BotMax { get; set; }
public int? BotMaxPvE { get; set; }
public int? BotStart { get; set; }
public int? BotStartPlayer { get; set; }
public int? BotStop { get; set; }
public int? BotMaxTimePlayer { get; set; }
public int? BotSpawnTimeOnMin { get; set; }
public int? BotSpawnTimeOnMax { get; set; }
public int? BotSpawnTimeOffMin { get; set; }
public int? BotSpawnTimeOffMax { get; set; }
public int? BotMaxPlayer { get; set; }
public int? BotEasy { get; set; }
public int? BotNormal { get; set; }
public int? BotHard { get; set; }
public int? BotImpossible { get; set; }
public int? BotAssault { get; set; }
public int? BotMarksman { get; set; }
public string? DisabledScavExits { get; set; }
public int? MinPlayerLvlAccessKeys { get; set; }
public List<object>? AccessKeys { get; set; }
public int? UnixDateTime { get; set; }
[JsonPropertyName("users_gather_seconds")] public int? UsersGatherSeconds { get; set; }
[JsonPropertyName("users_spawn_seconds_n")] public int? UsersSpawnSecondsN { get; set; }
[JsonPropertyName("users_spawn_seconds_n2")] public int? UsersSpawnSecondsN2 { get; set; }
[JsonPropertyName("users_summon_seconds")] public int? UsersSummonSeconds { get; set; }
[JsonPropertyName("sav_summon_seconds")] public int? SavSummonSeconds { get; set; }
[JsonPropertyName("matching_min_seconds")] public int? MatchingMinSeconds { get; set; }
public bool? GenerateLocalLootCache { get; set; }
public int? PlayersRequestCount { get; set; }
public NonWaveGroupScenario? NonWaveGroupScenario { get; set; }
public int? BotSpawnCountStep { get; set; }
public int? BotSpawnPeriodCheck { get; set; }
public float? GlobalContainerChanceModifier { get; set; }
public List<object>? MinMaxBots { get; set; }
public BotLocationModifier? BotLocationModifier { get; set; }
public List<Exit>? Exits { get; set; }
public bool? DisabledForScav { get; set; }
public List<object>? BossLocationSpawn { get; set; }
public List<SpawnPointParam>? SpawnPointParams { get; set; }
public List<object>? MaxItemCountInLocation { get; set; }
public List<AirdropParameter>? AirdropParameters { get; set; }
public List<MatchMakerMinPlayersByWaitTime>? MatchMakerMinPlayersByWaitTime { get; set; }
public List<Transit>? Transits { get; set; }
public required string Id { get; set; }
[JsonPropertyName("_Id")] public string? Id0 { get; set; }
public required List<Template> Loot { get; set; }
public List<Banner>? Banners { get; set; }
}
public record LocationLoot(
bool Enabled,
bool EnableCoop,
bool ForceOnlineRaidInPve,
bool Locked,
bool Insurance,
bool SafeLocation,
string Name,
string Description,
Scene Scene,
float Area,
int RequiredPlayerLevelMin,
int RequiredPlayerLevelMax,
int PmcMaxPlayersInGroup,
int ScavMaxPlayersInGroup,
int MinPlayers,
int MaxPlayers,
int MaxCoopGroup,
int ExitCount,
int ExitAccessTime,
int ExitTime,
Preview Preview,
int IconX,
int IconY,
IReadOnlyList<object> FilterEx,
IReadOnlyList<object> Waves,
IReadOnlyList<object> Limits,
int AveragePlayTime,
int AveragePlayerLevel,
int EscapeTimeLimit,
int EscapeTimeLimitPve,
int EscapeTimeLimitCoop,
string Rules,
bool IsSecret,
IReadOnlyList<object> Doors,
[property: JsonPropertyName("tmp_location_field_remove_me")] int TmpLocationFieldRemoveMe,
int MinDistToExitPoint,
int MaxDistToFreePoint,
int MinDistToFreePoint,
int MaxBotPerZone,
string OpenZones,
bool OcculsionCullingEnabled,
float GlobalLootChanceModifier,
float GlobalLootChanceModifierPvE,
bool OldSpawn,
bool OfflineOldSpawn,
bool NewSpawn,
bool OfflineNewSpawn,
int BotMax,
int BotMaxPvE,
int BotStart,
int BotStartPlayer,
int BotStop,
int BotMaxTimePlayer,
int BotSpawnTimeOnMin,
int BotSpawnTimeOnMax,
int BotSpawnTimeOffMin,
int BotSpawnTimeOffMax,
int BotMaxPlayer,
int BotEasy,
int BotNormal,
int BotHard,
int BotImpossible,
int BotAssault,
int BotMarksman,
string DisabledScavExits,
int MinPlayerLvlAccessKeys,
IReadOnlyList<object> AccessKeys,
int UnixDateTime,
[property: JsonPropertyName("users_gather_seconds")] int UsersGatherSeconds,
[property: JsonPropertyName("users_spawn_seconds_n")] int UsersSpawnSecondsN,
[property: JsonPropertyName("users_spawn_seconds_n2")] int UsersSpawnSecondsN2,
[property: JsonPropertyName("users_summon_seconds")] int UsersSummonSeconds,
[property: JsonPropertyName("sav_summon_seconds")] int SavSummonSeconds,
[property: JsonPropertyName("matching_min_seconds")] int MatchingMinSeconds,
bool GenerateLocalLootCache,
int PlayersRequestCount,
NonWaveGroupScenario NonWaveGroupScenario,
int BotSpawnCountStep,
int BotSpawnPeriodCheck,
float GlobalContainerChanceModifier,
IReadOnlyList<object> MinMaxBots,
BotLocationModifier BotLocationModifier,
IReadOnlyList<Exit> Exits,
bool DisabledForScav,
IReadOnlyList<object> BossLocationSpawn,
IReadOnlyList<SpawnPointParam> SpawnPointParams,
IReadOnlyList<object> MaxItemCountInLocation,
IReadOnlyList<AirdropParameter> AirdropParameters,
IReadOnlyList<MatchMakerMinPlayersByWaitTime> MatchMakerMinPlayersByWaitTime,
IReadOnlyList<Transit> Transits,
string Id,
[property: JsonPropertyName("_Id")] string Id0,
IReadOnlyList<Template> Loot,
IReadOnlyList<Banner> Banners
);

View File

@ -1,48 +1,8 @@
namespace LootDumpProcessor.Model.Input;
public class MapSettings
{
public string? MapID { get; set; }
public float? ChanceSpawn { get; set; }
public Vector3? SpawnPeriod { get; set; }
public float? MoveSpeed { get; set; }
public float? ReadyToDepartureTime { get; set; }
public float? CheckTurnDistanceTime { get; set; }
public float? TurnCheckSensitivity { get; set; }
public float? DecreaseSpeedOnTurnLimit { get; set; }
public float? EndSplineDecelerationDistance { get; set; }
public float? AccelerationSpeed { get; set; }
public float? DecelerationSpeed { get; set; }
public Vector3? PauseDurationRange { get; set; }
public float? BodySwingReturnSpeed { get; set; }
public float? BodySwingDamping { get; set; }
public float? BodySwingIntensity { get; set; }
}
public readonly record struct MapSettings(
string MapId, float ChanceSpawn, Vector3 SpawnPeriod, float MoveSpeed, float ReadyToDepartureTime,
float CheckTurnDistanceTime, float TurnCheckSensitivity, float DecreaseSpeedOnTurnLimit,
float EndSplineDecelerationDistance, float AccelerationSpeed, float DecelerationSpeed, Vector3 PauseDurationRange,
float BodySwingReturnSpeed, float BodySwingDamping, float BodySwingIntensity
);

View File

@ -1,9 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class MatchMakerMinPlayersByWaitTime
{
public int? Time { get; set; }
public int? MinPlayers { get; set; }
}
public readonly record struct MatchMakerMinPlayersByWaitTime(int Time, int MinPlayers);

View File

@ -1,15 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class NonWaveGroupScenario
{
public int? MinToBeGroup { get; set; }
public int? MaxToBeGroup { get; set; }
public float? Chance { get; set; }
public bool? Enabled { get; set; }
}
public readonly record struct NonWaveGroupScenario(int MinToBeGroup, int MaxToBeGroup, float Chance, bool Enabled);

View File

@ -1,9 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Pic
{
public string? Path { get; set; }
public string? Rcid { get; set; }
}
public readonly record struct Pic(string? Path, string? Rcid);

View File

@ -1,9 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Preview
{
public string? Path { get; set; }
public string? Rcid { get; set; }
}
public readonly record struct Preview(string? Path, string? Rcid);

View File

@ -1,9 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Props
{
public Vector3? Center { get; set; }
public float? Radius { get; set; }
}
public readonly record struct Props(Vector3 Center, float Radius);

View File

@ -1,9 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Requirements
{
public List<CompletedQuest>? CompletedQuests { get; set; }
public object? Standings { get; set; }
}
public readonly record struct Requirements(IReadOnlyList<CompletedQuest> CompletedQuests, object Standings);

View File

@ -1,12 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class RootData
{
public int? Err { get; set; }
public required Data Data { get; set; }
public object? Errmsg { get; set; }
}
public record RootData(int Err, Data Data, object Errmsg);

View File

@ -1,9 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Scene
{
public string? Path { get; set; }
public string? Rcid { get; set; }
}
public readonly record struct Scene(string Path, string Rcid);

View File

@ -1,12 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class ServerMapBTRSettings
{
public MapSettings? Develop { get; set; }
public MapSettings? TarkovStreets { get; set; }
public MapSettings? Woods { get; set; }
}
public readonly record struct ServerMapBTRSettings(MapSettings Develop, MapSettings TarkovStreets, MapSettings Woods);

View File

@ -1,9 +1,5 @@
namespace LootDumpProcessor.Model.Input;
public class ServerSettings
{
public TraderServerSettings? TraderServerSettings { get; set; }
public BTRServerSettings? BTRServerSettings { get; set; }
}
public readonly record struct ServerSettings(
TraderServerSettings TraderServerSettings, BTRServerSettings BtrServerSettings
);

View File

@ -1,6 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class ServiceItemCost
{
public Dictionary<string, ItemCost>? Costs { get; set; }
}
public readonly record struct ServiceItemCost(IReadOnlyDictionary<string, ItemCost> Costs);

View File

@ -1,33 +1,7 @@
namespace LootDumpProcessor.Model.Input;
public class SpawnPointParam
{
public string? Id { get; set; }
public Vector3? Position { get; set; }
public float? Rotation { get; set; }
public List<string>? Sides { get; set; }
public List<string>? Categories { get; set; }
public string? Infiltration { get; set; }
public float? DelayToCanSpawnSec { get; set; }
public ColliderParams? ColliderParams { get; set; }
public string? BotZoneName { get; set; }
public int? CorePointId { get; set; }
}
public readonly record struct SpawnPointParam(
string Id, Vector3 Position, float Rotation, IReadOnlyList<string> Sides, IReadOnlyList<string> Categories,
string Infiltration,
float DelayToCanSpawnSec, ColliderParams ColliderParams, string BotZoneName, int CorePointId
);

View File

@ -1,6 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Standing
{
public float? Value { get; set; }
}
public readonly record struct Standing(float Value);

View File

@ -1,6 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class TraderServerSettings
{
public TraderServices? TraderServices { get; set; }
}
public readonly record struct TraderServerSettings(TraderServices? TraderServices);

View File

@ -1,18 +1,6 @@
namespace LootDumpProcessor.Model.Input;
public class TraderService
{
public string? TraderID { get; set; }
public string? TraderServiceType { get; set; }
public Requirements? Requirements { get; set; }
public object? ServiceItemCost { get; set; }
public List<object>? UniqueItems { get; set; }
}
public readonly record struct TraderService(
string TraderId, string TraderServiceType, Requirements Requirements, object ServiceItemCost,
IReadOnlyList<object> UniqueItems
);

View File

@ -1,24 +1,6 @@
namespace LootDumpProcessor.Model.Input;
public class TraderServices
{
public TraderService? ExUsecLoyalty { get; set; }
public TraderService? ZryachiyAid { get; set; }
public TraderService? CultistsAid { get; set; }
public TraderService? PlayerTaxi { get; set; }
public TraderService? BtrItemsDelivery { get; set; }
public TraderService? BtrBotCover { get; set; }
public TraderService? TransitItemsDelivery { get; set; }
}
public readonly record struct TraderServices(
TraderService? ExUsecLoyalty, TraderService? ZryachiyAid, TraderService? CultistsAid, TraderService? PlayerTaxi,
TraderService? BtrItemsDelivery, TraderService? BtrBotCover, TraderService? TransitItemsDelivery
);

View File

@ -1,30 +1,6 @@
namespace LootDumpProcessor.Model.Input;
public class Transit
{
public int? Id { get; set; }
public bool? Active { get; set; }
public string? Name { get; set; }
public string? Location { get; set; }
public string? Description { get; set; }
public int? ActivateAfterSec { get; set; }
public string? Target { get; set; }
public int? Time { get; set; }
public string? Conditions { get; set; }
}
public readonly record struct Transit(
int Id, bool Active, string Name, string Location, string Description, int ActivateAfterSec, string Target,
int Time, string Conditions
);

View File

@ -1,6 +1,3 @@
namespace LootDumpProcessor.Model.Input;
public class Update
{
public int? StackObjectsCount { get; set; }
}
public readonly record struct Update(int StackObjectsCount);

View File

@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
using LootDumpProcessor.Utils;
namespace LootDumpProcessor.Model;
@ -39,6 +38,6 @@ public class Item : ICloneable
ParentId = ParentId,
SlotId = SlotId,
Location = Location,
Upd = ProcessorUtil.Copy(Upd)
Upd = Upd
};
}

View File

@ -1,15 +1,3 @@
namespace LootDumpProcessor.Model;
public class Repairable : ICloneable
{
public int? Durability { get; set; }
public int? MaxDurability { get; set; }
public object Clone() => new Repairable
{
Durability = Durability,
MaxDurability = MaxDurability
};
}
public readonly record struct Repairable(int Durability, int MaxDurability);

View File

@ -58,8 +58,8 @@ public class Template : IKeyable, ICloneable
IsContainer,
UseGravity,
RandomRotation,
ProcessorUtil.Copy(Position),
ProcessorUtil.Copy(Rotation),
Position,
Rotation,
IsGroupPosition,
ProcessorUtil.Copy(GroupPositions),
IsAlwaysSpawn,

View File

@ -1,26 +1,5 @@
using LootDumpProcessor.Utils;
namespace LootDumpProcessor.Model;
public class Upd : ICloneable
{
public object? StackObjectsCount { get; set; }
public FireMode? FireMode { get; set; }
public Foldable? Foldable { get; set; }
public Repairable? Repairable { get; set; }
public object Clone() => new Upd
{
StackObjectsCount = StackObjectsCount,
FireMode = ProcessorUtil.Copy(FireMode),
Foldable = ProcessorUtil.Copy(Foldable),
Repairable = ProcessorUtil.Copy(Repairable)
};
}
public readonly record struct Upd(
object? StackObjectsCount, FireMode FireMode, Foldable Foldable, Repairable Repairable
);

View File

@ -1,19 +1,3 @@
namespace LootDumpProcessor.Model;
public class Vector3 : ICloneable
{
public float? X { get; set; }
public float? Y { get; set; }
public float? Z { get; set; }
public object Clone() => new Vector3
{
X = X,
Y = Y,
Z = Z
};
}
public readonly record struct Vector3(float X, float Y, float Z);

View File

@ -1,14 +1,11 @@
using System.Collections.Concurrent;
using System.Text.Json;
using LootDumpProcessor;
using LootDumpProcessor.Model;
using LootDumpProcessor.Model.Input;
using LootDumpProcessor.Model.Output;
using LootDumpProcessor.Model.Output.LooseLoot;
using LootDumpProcessor.Model.Output.StaticContainer;
using LootDumpProcessor.Model.Processing;
using LootDumpProcessor.Process;
using LootDumpProcessor.Process.Processor.DumpProcessor;
using LootDumpProcessor.Process.Processor.v2.AmmoProcessor;
using LootDumpProcessor.Process.Processor.v2.LooseLootProcessor;
using LootDumpProcessor.Process.Processor.v2.StaticContainersProcessor;
@ -19,6 +16,8 @@ using LootDumpProcessor.Storage.Collections;
using LootDumpProcessor.Utils;
using Microsoft.Extensions.Logging;
namespace LootDumpProcessor.Process.Processor.DumpProcessor;
public class MultithreadSteppedDumpProcessor(
IStaticLootProcessor staticLootProcessor,
IStaticContainersProcessor staticContainersProcessor,

View File

@ -1,11 +1,12 @@
using LootDumpProcessor.Model;
using LootDumpProcessor.Model.Processing;
using LootDumpProcessor.Process.Processor.FileProcessor;
using LootDumpProcessor.Process.Processor.v2.LooseLootProcessor;
using LootDumpProcessor.Process.Processor.v2.StaticLootProcessor;
using LootDumpProcessor.Storage;
using Microsoft.Extensions.Logging;
namespace LootDumpProcessor.Process.Processor.FileProcessor;
public class FileProcessor : IFileProcessor
{
private readonly IStaticLootProcessor _staticLootProcessor;

View File

@ -3,8 +3,8 @@ using LootDumpProcessor.Model.Input;
using LootDumpProcessor.Model.Output.StaticContainer;
using LootDumpProcessor.Utils;
using Microsoft.Extensions.Logging;
using LootDumpProcessor;
using LootDumpProcessor.Process.Processor.v2.StaticContainersProcessor;
namespace LootDumpProcessor.Process.Processor.v2.StaticContainersProcessor;
public class StaticContainersProcessor : IStaticContainersProcessor
{

View File

@ -1,13 +1,13 @@
using System.Collections.Concurrent;
using System.Text.Json;
using LootDumpProcessor;
using LootDumpProcessor.Model.Input;
using LootDumpProcessor.Model.Processing;
using LootDumpProcessor.Process.Reader.Intake;
using LootDumpProcessor.Serializers.Json;
using LootDumpProcessor.Utils;
using Microsoft.Extensions.Logging;
namespace LootDumpProcessor.Process.Reader.Intake;
public class JsonFileIntakeReader(ILogger<JsonFileIntakeReader> logger) : IIntakeReader
{
private readonly ILogger<JsonFileIntakeReader> _logger = logger ?? throw new ArgumentNullException(nameof(logger));
@ -43,7 +43,7 @@ public class JsonFileIntakeReader(ILogger<JsonFileIntakeReader> logger) : IIntak
_logger.LogError("Could not parse date from file: {File}", file);
var fi = JsonSerializer.Deserialize<RootData>(fileData, JsonSerializerSettings.Default);
if (fi?.Data?.LocationLoot?.Name != null && (!_ignoredLocations?.Contains(fi.Data.LocationLoot.Name) ?? true))
if (fi?.Data.LocationLoot.Name != null && (!_ignoredLocations?.Contains(fi.Data.LocationLoot.Name) ?? true))
{
var mapName = fi.Data.LocationLoot.Name;
var mapId = fi.Data.LocationLoot.Id.ToLower();

View File

@ -7,8 +7,8 @@ namespace LootDumpProcessor.Utils;
public static class ProcessorUtil
{
public static string GetSaneId(this Template x) =>
$"({x.Position.X}, {x.Position.Y}, {x.Position.Z}, {Math.Round(x.Rotation.X ?? 0, 3)}," +
$" {Math.Round(x.Rotation.Y ?? 0, 3)}, {Math.Round(x.Rotation.Z ?? 0, 3)}," +
$"({x.Position.X}, {x.Position.Y}, {x.Position.Z}, {Math.Round(x.Rotation.X, 3)}," +
$" {Math.Round(x.Rotation.Y, 3)}, {Math.Round(x.Rotation.Z, 3)}," +
$" {x.UseGravity}, {x.IsGroupPosition})";
public static string GetLocationId(this Template x) => $"({x.Position.X}, {x.Position.Y}, {x.Position.Z})";
@ -25,9 +25,5 @@ public static class ProcessorUtil
return obj?.Select(o => o.Clone()).Cast<T>().ToList();
}
public static string HashFile(string text)
{
var sha256 = SHA256.Create();
return Convert.ToBase64String(sha256.ComputeHash(Encoding.UTF8.GetBytes(text)));
}
public static string HashFile(string text) => Convert.ToBase64String(SHA256.HashData(Encoding.UTF8.GetBytes(text)));
}