예제 #1
0
 public void PlayerWon(Player player)
 {
     if(AnyPlayerIsMoving())
     {
         _eventPublisher.Publish(new PlayerWonEvent
         {
             Player = player
         });
     }
 }
예제 #2
0
 private PlayersState(IEventPublisher eventPublisher, IPhutballOptions options, Player first, Player second)
 {
     _eventPublisher = eventPublisher;
     _options = options;
     Initialize(first, second);
 }
예제 #3
0
 private void Initialize(Player first, Player second)
 {
     First = new PlayerOnBoardInfo(first);
     Second = new PlayerOnBoardInfo(second);
     _switch = new Switch<PlayerOnBoardInfo>(First, Second);
     first.IsOnTheMove = false;
     second.IsOnTheMove = false;
 }
예제 #4
0
 private PlayersState(Player first, Player second)
     : this(EventPublisher.Empty(), new PhutballOptions(), first, second)
 {
 }
예제 #5
0
 public PlayerOnBoardInfo(Player player)
 {
     Player = player;
     _timer = new Stopwatch();
 }