Implement phase 6 critical effect normalization
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
namespace RolemasterDb.App.Features;
|
||||
|
||||
public sealed record CriticalEffectLookupResponse(
|
||||
string EffectCode,
|
||||
string? Target,
|
||||
int? ValueInteger,
|
||||
string? ValueExpression,
|
||||
int? DurationRounds,
|
||||
int? PerRound,
|
||||
int? Modifier,
|
||||
string? BodyPart,
|
||||
bool IsPermanent,
|
||||
string SourceType,
|
||||
string? SourceText);
|
||||
@@ -52,6 +52,7 @@ public sealed record CriticalBranchLookupResponse(
|
||||
string ConditionText,
|
||||
string Description,
|
||||
string? AffixText,
|
||||
IReadOnlyList<CriticalEffectLookupResponse> Effects,
|
||||
string RawText,
|
||||
int SortOrder);
|
||||
|
||||
@@ -73,6 +74,7 @@ public sealed record CriticalLookupResponse(
|
||||
string RawCellText,
|
||||
string Description,
|
||||
string? AffixText,
|
||||
IReadOnlyList<CriticalEffectLookupResponse> Effects,
|
||||
IReadOnlyList<CriticalBranchLookupResponse> Branches,
|
||||
string ParseStatus,
|
||||
string ParsedJson);
|
||||
|
||||
@@ -132,6 +132,21 @@ public sealed class LookupService(IDbContextFactory<RolemasterDbContext> dbConte
|
||||
item.RawCellText,
|
||||
item.DescriptionText,
|
||||
item.RawAffixText,
|
||||
item.Effects
|
||||
.OrderBy(effect => effect.Id)
|
||||
.Select(effect => new CriticalEffectLookupResponse(
|
||||
effect.EffectCode,
|
||||
effect.Target,
|
||||
effect.ValueInteger,
|
||||
effect.ValueExpression,
|
||||
effect.DurationRounds,
|
||||
effect.PerRound,
|
||||
effect.Modifier,
|
||||
effect.BodyPart,
|
||||
effect.IsPermanent,
|
||||
effect.SourceType,
|
||||
effect.SourceText))
|
||||
.ToList(),
|
||||
item.Branches
|
||||
.OrderBy(branch => branch.SortOrder)
|
||||
.Select(branch => new CriticalBranchLookupResponse(
|
||||
@@ -140,6 +155,21 @@ public sealed class LookupService(IDbContextFactory<RolemasterDbContext> dbConte
|
||||
branch.ConditionText,
|
||||
branch.DescriptionText,
|
||||
branch.RawAffixText,
|
||||
branch.Effects
|
||||
.OrderBy(effect => effect.Id)
|
||||
.Select(effect => new CriticalEffectLookupResponse(
|
||||
effect.EffectCode,
|
||||
effect.Target,
|
||||
effect.ValueInteger,
|
||||
effect.ValueExpression,
|
||||
effect.DurationRounds,
|
||||
effect.PerRound,
|
||||
effect.Modifier,
|
||||
effect.BodyPart,
|
||||
effect.IsPermanent,
|
||||
effect.SourceType,
|
||||
effect.SourceText))
|
||||
.ToList(),
|
||||
branch.RawText,
|
||||
branch.SortOrder))
|
||||
.ToList(),
|
||||
|
||||
Reference in New Issue
Block a user