Exemple #1
0
 public void RemoveIGamePlayList(IGamePlay igamePlay)
 {
     if (!gamePlayList.Contains(igamePlay))
     {
         Debug.Log("Already remove from IGamePlayList");
         return;
     }
     gamePlayDeleteBuffer.Add(igamePlay);
 }
Exemple #2
0
 public GameBoardViewModel(IGameBoard gameBoard, IGamePlay gamePlay)
 {
     _gameBoard           = gameBoard ?? throw new ArgumentNullException(nameof(gameBoard));
     _gamePlay            = gamePlay ?? throw new ArgumentNullException(nameof(gamePlay));
     _gameBoardAreaList   = _gameBoard.GameBoardAreaList;
     _placeATokenCommands = CreatePlaceATokenCommands();
     ContinueCommand      = new RelayCommand(ContinueExecute, ContinueCanExecute);
     StartGameWhenStartanimationCompletedCommand = new RelayCommand(StartanimationCompletedExecute);
 }
Exemple #3
0
 public void AddIGamePlayList(IGamePlay igamePlay)
 {
     if (gamePlayList.Contains(igamePlay))
     {
         Debug.Log("Already exist in IGamePlayList");
         return;
     }
     gamePlayAddBuffer.Add(igamePlay);
 }
Exemple #4
0
 public MainWindowViewModel(IMenuViewModel menuViewModel,
                            IGameBoardViewModel gameBoardViewModel,
                            IGameInfoViewModel gameInfoViewModel,
                            IGamePlay gamePlay,
                            IPlayerController playerController)
 {
     _menuViewModel      = menuViewModel ?? throw new ArgumentNullException(nameof(menuViewModel));
     _gameBoardViewModel = gameBoardViewModel ?? throw new ArgumentNullException(nameof(gameBoardViewModel));
     _gameInfoViewModel  = gameInfoViewModel ?? throw new ArgumentNullException(nameof(gameInfoViewModel));
     _gamePlay           = gamePlay ?? throw new ArgumentNullException(nameof(gamePlay));
     _playerController   = playerController ?? throw new ArgumentNullException(nameof(playerController));
 }
        public void Run()
        {
            ConsoleKey option = ConsoleKey.NoName;

            List <IGamePlay> _gameModes = LoadAvailableGamePlays();

            while (option != ConsoleKey.Escape)
            {
                Console.Clear();
                ShowOptionsMenu(_gameModes);
                Console.WriteLine("Seleziona una modalità: ");
                option = Console.ReadKey(true).Key;

                switch (option)
                {
                default:
                    if (option >= ConsoleKey.F1 && option <= ConsoleKey.F12)
                    {
                        if (WordRepository is null)
                        {
                            ManageSettings();
                        }
                        int index = option - ConsoleKey.F1;
                        if (index < _gameModes.Count && index >= 0)
                        {
                            IGamePlay game = _gameModes[index];
                            game.RegisterUIHandler(this);
                            game.Run();
                        }
                    }
                    else
                    {
                        Console.WriteLine("L'opzione scelta non è valida o non disponibile.");
                    }
                    break;

                case ConsoleKey.Escape:
                    Console.WriteLine("Grazie per aver giocato.");
                    break;

                case ConsoleKey.S:
                    ManageSettings();
                    break;
                }

                Console.ReadKey(true);
            }
        }
Exemple #6
0
 public GamePlayDecoretor(IGamePlay gamePlay)
 {
     _gamePlay = gamePlay;
 }
 public GameSetController(IGamePlay gamePlay, ISetGame gameSet, IMapper mapper)
 {
     _gamePlay = gamePlay;
     _gameSet  = gameSet;
     _mapper   = mapper;
 }
 public GameSetController(IGamePlay gamePlay)
 {
     _gamePlay = gamePlay;
 }
 public Game(IPlayer player, IMatch match, IGamePlay gamePlay)
 {
     _player = player;
     _match = match;
     _gamePlay = gamePlay;
 }
 public GamePlay(IGamePlay gamePlay1, IGamePlay gamePlay2)
 {
     _gamePlay1 = gamePlay1;
     _gamePlay2 = gamePlay2;
 }
 public State DetermineWinState(List<string> cells, IGamePlay gamePlay)
 {
     return gamePlay.GetState(cells);
 }