Пример #1
0
 public GameOverState(IGameplayController gameplayController,
                      IGameOverController gameOverController,
                      IScoreSystem scoreSystem)
 {
     this.gameplayController = gameplayController;
     this.gameOverController = gameOverController;
     this.scoreSystem        = scoreSystem;
 }
Пример #2
0
 public ScoreSystemFacade(IScoreSystem scoreSystem, IGameOverView gameOverView, IGameplayView gameplayView, IScoreSettings scoreSettings, IStartView startView)
 {
     this.scoreSystem   = scoreSystem;
     this.gameOverView  = gameOverView;
     this.gameplayView  = gameplayView;
     this.scoreSettings = scoreSettings;
     this.startView     = startView;
 }
Пример #3
0
        public MatchSystem(ILivesSystem livesSystem, IScoreSystem scoreSystem, uint matchCardsCount = 3)
        {
            _livesSystem = livesSystem;
            _scoreSystem = scoreSystem;

            _matchCardsCount = matchCardsCount;
            _selectedCards   = new List <ICard>((int)matchCardsCount);
        }
 public void RemoveScoreSystem(IScoreSystem scoreSystem)
 {
     try
     {
         scoreSystemRepository.RemoveScoreSystem(scoreSystem.Name);
     }
     catch (DatabaseException ex)
     {
         throw new ConnectionException(ex.Message);
     }
 }
Пример #5
0
        public void Initialize(IScoreSystem scoreSystem, ILivesSystem livesSystem, Action onBackButton)
        {
            _scoreSystem = scoreSystem;
            _livesSystem = livesSystem;

            UpdateScoreText();
            SetupLives();

            _scoreSystem.OnScoreUpdate += UpdateScoreText;
            _livesSystem.OnLifeRemove  += RemoveLife;
            backButton.onClick.AddListener(() => onBackButton());
        }
Пример #6
0
 public BeginGameState(IRoot root,
                       ILevelGenerator levelGenerator,
                       ITurnSystem turnSystem,
                       IMatchSystem matchSystem,
                       IGameplayController gameplayController,
                       IScoreSystem scoreSystem)
 {
     this.root               = root;
     this.levelGenerator     = levelGenerator;
     this.turnSystem         = turnSystem;
     this.matchSystem        = matchSystem;
     this.gameplayController = gameplayController;
     this.scoreSystem        = scoreSystem;
 }
Пример #7
0
        private void Awake()
        {
            _livesSystem = new LivesSystem();
            _scoreSystem = new ScoreSystem();
            _matchSystem = new MatchSystem(_livesSystem, _scoreSystem);

            _playField            = GetComponent <IPlayField>();
            _saveManager          = GetComponent <ISaveManager>();
            _inputSystem          = GetComponent <IInputSystem>();
            _roundUiManager       = GetComponent <IRoundUiManager>();
            _gameSceneManager     = GetComponent <IGameSceneManager>();
            _lightAndCameraSystem = GetComponent <ILightAndCameraSystem>();
            _cardMeshes           = GetComponent <CardReferences>().GetCardObjects();

            StartCoroutine(InitializeRound());
        }
Пример #8
0
        public void Initialize(IScoreSystem scoreSystem, ILivesSystem livesSystem, IGameSceneManager gameSceneManager, Func <IEnumerator> onRestart)
        {
            _gameSceneManager = gameSceneManager;

            var uiGameObject = Instantiate(roundUiPrefab, roundUiCanvas.transform);

            _roundUi = uiGameObject.GetComponent <IRoundUi>();
            _roundUi.Initialize(scoreSystem, livesSystem, OnBackButton);

            var endGameObject = Instantiate(endGamePrefab, roundUiCanvas.transform);

            _endGameWindow = endGameObject.GetComponent <IEndGameWindow>();
            _endGameWindow.Initialize();

            _endGameWindow.OnRestartButton += () => StartCoroutine(onRestart.Invoke());
            _endGameWindow.OnBackButton    += OnBackButton;
        }
        private void BtnRemoveScoreSystem_Click(object sender, RoutedEventArgs e)
        {
            if (LvScoreSystems.SelectedIndex >= 0)
            {
                IScoreSystem selectedScoreSystem = LvScoreSystems.SelectedItem as IScoreSystem;
                try
                {
                    scoreSystemCollection.RemoveScoreSystem(selectedScoreSystem);
                }
                catch (Exception exception)
                {
                    MessageBox.Show($"Could not remove the score system\nError: {exception.Message}", "Error",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }

                UpdateUi();
            }
        }
Пример #10
0
 public void SetScoreSystem(IScoreSystem scoreSystem)
 {
     scoreSystem.onScoreChanged.AddListener(ChangeScore);
     this.scoreSystem = scoreSystem;
 }
Пример #11
0
 public void EditScores(IScoreSystem scoreSystem)
 {
     throw new System.NotImplementedException();
 }