Files
basic-computer-games/77_Salvo/csharp/Targetting/ComputerShotSelector.cs
2023-04-23 17:56:01 +10:00

24 lines
525 B
C#

namespace Salvo.Targetting;
internal class ComputerShotSelector : ShotSelector
{
private readonly bool _displayShots;
internal ComputerShotSelector(Grid source, Grid target, bool displayShots)
: base(source, target)
{
_displayShots = displayShots;
}
private void DisplayShots(IEnumerable<Position> shots, IReadWrite io)
{
if (_displayShots)
{
foreach (var shot in shots)
{
io.WriteLine(shot);
}
}
}
}