Skip to content

Commit

Permalink
Slight readability change to generic constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
SokyranTheDragon committed Aug 1, 2024
1 parent 369328f commit 0a15ae3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/MultiplayerLoader/SyncRituals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,16 @@ void Register(Type baseType, string method, Type derivedType, Action<ISyncMethod
}

private static (WidgetType roleSelectionWidget, string Key) RitualRoleWriter<WidgetType, RoleType>(IEnumerable<RoleType> roles, object target, object[] _)
where WidgetType : PawnRoleSelectionWidgetBase<RoleType> where RoleType : class, ILordJobRole
where WidgetType : PawnRoleSelectionWidgetBase<RoleType>
where RoleType : class, ILordJobRole
{
var roleSelectionWidget = (WidgetType)target;
return (roleSelectionWidget, roleSelectionWidget.assignments.RoleGroups().FirstOrDefault(g => g.SequenceEqual(roles))?.Key);
}

private static IEnumerable<RoleType> RitualRoleReader<WidgetType, RoleType>((WidgetType roleSelectionWidget, string Key) data)
where WidgetType : PawnRoleSelectionWidgetBase<RoleType> where RoleType : class, ILordJobRole
where WidgetType : PawnRoleSelectionWidgetBase<RoleType>
where RoleType : class, ILordJobRole
{
return data.roleSelectionWidget.assignments.RoleGroups().FirstOrDefault(g => g.Key == data.Key);
}
Expand Down

0 comments on commit 0a15ae3

Please sign in to comment.