コード例 #1
0
 public KeyboardController(InGameViewModel viewModel, IGuessLetter guessLetter)
 {
     viewModel
     .OnKeyPressedPressed
     .Subscribe(letter =>
     {
         Debug.Assert(letter.Length == 1,
                      $"Something is wrong configured on KeyboardView, received {letter} and expected a letter of length 1");
         guessLetter.Guess(letter[0]);
     });
 }
コード例 #2
0
 public RestartGameController(InGameViewModel inGameViewModel, IRestartGame restartGame)
 {
     inGameViewModel.OnRestartGamePressed.Subscribe(_ => restartGame.Restart());
 }