/// <summary> /// copy of ctor /// </summary> private SticksGame(Player turn, int numberOfSticks, ICanGenerateNumbers generator, EventHandler <Move> onMachineMoved) { NumberOfSticks = numberOfSticks; Turn = turn; _generator = generator; MachineMoved = onMachineMoved; }
/// <summary> /// copy ctor /// </summary> private Game(Player turn, int numberOfSticks, ICanGenerateNumbers generator, EventHandler <Move> onMachineMoved, EventHandler <Player> onGameOver) { NumberOfSticks = numberOfSticks; Turn = turn; _generator = generator; MachineMoved = onMachineMoved; GameOver = onGameOver; }
public SticksGame(int numberOfSticks, Player turn, ICanGenerateNumbers generator) { if (numberOfSticks < 10) { throw new ArgumentException($"Number of sticks has to be >= 10. You passed:{numberOfSticks}"); } _generator = generator; NumberOfSticks = numberOfSticks; Turn = turn; }