Skip to content

Commit

Permalink
Add support for multiple rewards in assignments
Browse files Browse the repository at this point in the history
fix #109
  • Loading branch information
dealloc committed Nov 10, 2024
1 parent ab55704 commit 9ee18da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Helldivers-2-Core/Mapping/V1/AssignmentMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private Assignment MapToV1(Dictionary<string, Models.ArrowHead.Assignment> trans
Description: LocalizedMessage.FromStrings(descriptions),
Tasks: invariant.Setting.Tasks.Select(MapToV1).ToList(),
Reward: MapToV1(invariant.Setting.Reward),
Rewards: invariant.Setting.Rewards.Select(MapToV1).ToList(),
Expiration: expiration
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Helldivers-2-Models/ArrowHead/Assignments/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
/// <param name="OverrideBrief">The briefing (description) of this assignment.</param>
/// <param name="TaskDescription">A description of what is expected of Helldivers to complete the assignment.</param>
/// <param name="Tasks">A list of <see cref="Task" />s describing the assignment requirements.</param>
/// <param name="Reward">Contains information on the rewards players willr eceive upon completion.</param>
/// <param name="Reward">Contains information on the reward players will receive upon completion.</param>
/// <param name="Rewards">Contains information on the rewards players will receive upon completion.</param>
/// <param name="Flags">Flags, suspected to be a binary OR'd value, purpose unknown.</param>
public sealed record Setting(
int Type,
Expand All @@ -17,5 +18,6 @@ public sealed record Setting(
string TaskDescription,
List<Task> Tasks,
Reward Reward,
List<Reward> Rewards,
int Flags
);
2 changes: 2 additions & 0 deletions src/Helldivers-2-Models/V1/Assignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Helldivers.Models.V1;
/// <param name="Description">A very short summary of the description.</param>
/// <param name="Tasks">A list of tasks that need to be completed for this assignment.</param>
/// <param name="Reward">The reward for completing the assignment.</param>
/// <param name="Rewards">A list of rewards for completing the assignment.</param>
/// <param name="Expiration">The date when the assignment will expire.</param>
public sealed record Assignment(
long Id,
Expand All @@ -24,5 +25,6 @@ public sealed record Assignment(
LocalizedMessage Description,
List<Task> Tasks,
Reward Reward,
List<Reward> Rewards,
DateTime Expiration
);

0 comments on commit 9ee18da

Please sign in to comment.