Ejemplo n.º 1
0
    private void InvokeGameCompleted()
    {
        GameManager.Instance.ChangePauseState(this, false);

        if (currentResult != GameResult.None)
        {
            GameCompleted?.Invoke(LevelManager.Instance.SelectedChapter, LevelManager.Instance.CurrentLevel, LevelManager.Instance.SelectedLevel.GetCurrentStar().Number, CurrentScore, currentResult, LevelManager.Instance.DailyChallenge);
        }

        currentResult = GameResult.None;
    }
Ejemplo n.º 2
0
    // Call this when the player completes the task
    public virtual void OnCompleted()
    {
        AddAudioSource();

        if (GameCompleted != null)
        {
            if (onCompleteAudioClip != null)
            {
                audioSource.PlayOneShot(onCompleteAudioClip);
            }
            GameCompleted.Invoke();
        }
    }
Ejemplo n.º 3
0
 private void GameTick(object sender, EventArgs e)
 {
     if (!m_ComponentManager.HasWinner)
     {
         m_ComponentManager.Update();
         Refresh();
     }
     else
     {
         GameTimer.Stop();
         GameCompleted?.Invoke(this);
     }
 }
Ejemplo n.º 4
0
        void Reload(string serializedBoard)
        {
            if (string.IsNullOrWhiteSpace(serializedBoard))
            {
                return;
            }

            var lines = serializedBoard.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

            if (!lines.Any())
            {
                return;
            }

            items.Clear();

            foreach (var line in lines)
            {
                var values      = line.Split(new string[] { ":" }, StringSplitOptions.None);
                var coordinateX = default(int);
                var coordinateY = default(int);

                if (int.TryParse(values[0], out coordinateX) &&
                    int.TryParse(values[1], out coordinateY))
                {
                    var shape = values[2];

                    items.Add(Tuple.Create(coordinateX, coordinateY, shape ?? string.Empty));
                }
            }

            if (items.Count == 9)
            {
                GameCompleted?.Invoke(this, EventArgs.Empty);
            }
            else
            {
                Reloaded?.Invoke(this, EventArgs.Empty);
            }
        }
Ejemplo n.º 5
0
 private void OnGameCompleted(EventArgs e)
 {
     GameCompleted?.Invoke(this, e);
 }
Ejemplo n.º 6
0
 protected virtual void OnGameCompleted(Participant e)
 {
     GenerateRandomPuzzle();
     GameCompleted?.Invoke(this, e);
 }
Ejemplo n.º 7
0
 protected virtual void OnGameCompleted(FieldState e)
 {
     GameCompleted?.Invoke(this, e);
 }