Initial commit
This commit is contained in:
commit
b087f272b4
26 changed files with 5345 additions and 0 deletions
56
Numbers/NumberFactory/AbstractNumbers.cs
Normal file
56
Numbers/NumberFactory/AbstractNumbers.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue