예제 #1
0
 /// <summary>
 /// copy of ctor
 /// </summary>
 private SticksGame(Player turn, int numberOfSticks, ICanGenerateNumbers generator, EventHandler <Move> onMachineMoved)
 {
     NumberOfSticks = numberOfSticks;
     Turn           = turn;
     _generator     = generator;
     MachineMoved   = onMachineMoved;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
        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;
        }