ex-int-05-numbers/Numbers/NumberFactory/AbstractNumbers.cs
github-classroom[bot] b087f272b4
Initial commit
2025-04-29 15:03:45 +00:00

56 lines
1.5 KiB
C#

using System.Collections;
namespace Numbers.NumberFactory;
/// <summary>
/// Base class for <see cref="INumbers" /> implementations
/// </summary>
/// <inheritdoc cref="INumbers" />
public abstract class AbstractNumbers : INumbers
{
// TODO
// private readonly List<long> _list;
/// <summary>
/// Creates a new instance of <see cref="AbstractNumbers" /> with the given bounds.
/// Will generate the appropriate numbers based on the implementation of <see cref="PickNumber" />.
/// </summary>
/// <param name="lowerBound">Lower bound of the number range</param>
/// <param name="upperBound">Upper bound of the number range</param>
protected AbstractNumbers(long lowerBound, long upperBound)
{
// TODO
}
public long this[int index]
{
get
{
// TODO
return -1L;
}
}
public long LowerBound { get; }
public long UpperBound { get; }
public int Length => -1; // TODO
public IEnumerator<long> GetEnumerator() => null!; // TODO
IEnumerator IEnumerable.GetEnumerator() => null!; // TODO
private void GenerateNumbers()
{
// TODO
}
/// <summary>
/// Determines whether the given number should be picked based on the task of a
/// specific <see cref="INumbers" /> implementation
/// </summary>
/// <param name="number">Number to check</param>
/// <returns>True if the number should be picked; false otherwise</returns>
protected abstract bool PickNumber(long number);
}