Files
basic-computer-games/77_Salvo/csharp/Targetting/ShotSelectionStrategy.cs
2023-05-20 17:12:48 +10:00

18 lines
569 B
C#

namespace Salvo.Targetting;
internal abstract class ShotSelectionStrategy
{
private readonly ShotSelector _shotSelector;
protected ShotSelectionStrategy(ShotSelector shotSelector)
{
_shotSelector = shotSelector;
}
internal abstract IEnumerable<Position> GetShots(int numberOfShots);
protected bool WasSelectedPreviously(Position position) => _shotSelector.WasSelectedPreviously(position);
protected bool WasSelectedPreviously(Position position, out int turn)
=> _shotSelector.WasSelectedPreviously(position, out turn);
}