Initial commit

This commit is contained in:
github-classroom[bot] 2025-04-24 07:02:41 +00:00 committed by GitHub
commit 1be1863b20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 6449 additions and 0 deletions

View file

@ -0,0 +1,24 @@
namespace MeetTheTeacher.Model.Comparison;
/// <summary>
/// Base class for comparers which allow switching between ascending and descending mode
/// </summary>
public abstract class ComparerBase
{
/// <summary>
/// Creates a new instance of <see cref="ComparerBase" /> configured to sort in ascending or descending order
/// </summary>
/// <param name="ascending">Flag indicating if items should be sorted in ascending order; descending if false</param>
protected ComparerBase(bool ascending)
{
Ascending = ascending;
}
/// <summary>
/// Gets if the comparer is configured to sort in ascending order; descending if false
/// </summary>
protected bool Ascending { get; }
// TODO: consider moving the basic RefEquals code of CompareTo from the subclasses here
// maybe also rename this to SortOrderComparerBase or something and introduce another, common base class for all three?
}