Skip to content

[UI/Core Split] Refactor IsSorted in Utilities #175

@benfleuty

Description

@benfleuty

Similar to AlphabetiseModList, the IsSorted method in Utilities.cs operates directly on a BindingList<Mod>. The sorting check itself is a piece of core logic that doesn't strictly belong in a UI-focused list type.

To maintain a cleaner separation, the sorting validation should be performed on a core collection type.

Action:

  1. Create a new method in a core-level class (e.g., ModService.cs or CollectionsUtils.cs) that accepts a List<Mod> and returns a boolean indicating if it is sorted.
  2. Move the sorting check logic from IsSorted to this new core method.
  3. Modify IsSorted to call the new core method, or ideally, have the UI call the core method directly for validation.
  4. Update any code that uses IsSorted to align with the refactored structure.
  5. Add or update tests for the core sorting validation logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions