Exemplo n.º 1
0
        public void OnShieldRecharged(Entity subject)
        {
            foreach (Status s in statuses)
            {
                s.OnShieldRecharged(subject);
            }

            shieldRecharged?.Invoke(subject);
        }
        public void TriggerEvent(string eventName, GameObject src, EventArgs args)
        {
            BasicEvent basicEvent = GetEvent(eventName);

            Debug.Log("in manager, triggering event");
            if (basicEvent != null)
            {
                Debug.Log("in manager, got event, triggered");
                basicEvent.Invoke(src, args);
            }
        }
 private void Next()
 {
     if (TryGetCardPhase(out Card card))
     {
         _store.CurrentCard = card;
         _onChangeCard?.Invoke(new CardPayload(
                                   card,
                                   GetBackgroundColor(),
                                   _feedbackMap.GetSprite(card.AcceptFeedback),
                                   _feedbackMap.GetSprite(card.RejectFeedback),
                                   GetOutcome(card)));
         ChangeState(GameState.Card);
     }
     else
     {
         _onEndGame?.Invoke();
         ChangeState(GameState.TitleScreen);
     }
 }
Exemplo n.º 4
0
        public bool OnDeath(Entity subject)
        {
            bool continueDeath = true;

            foreach (Status s in statuses)
            {
                if (!s.OnDeath(subject))
                {
                    continueDeath = false;
                }
            }

            if (continueDeath)
            {
                death?.Invoke(subject);
                return(true);
            }
            return(false);
        }
 public void Begin()
 {
     CleanUp();
     Next();
     _onBeginGame?.Invoke();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Signal to the GameManager that the user has left-swiped on the current card.
 /// </summary>
 private void RequestReject() => _onReject?.Invoke();
Exemplo n.º 7
0
 /// <summary>
 /// Signal to the GameManager that the user has right-swiped on the current card.
 /// </summary>
 private void RequestAccept() => _onAccept?.Invoke();
Exemplo n.º 8
0
 /// <summary>
 /// Signal to the GameManager that the game should start.
 /// </summary>
 private void RequestBegin() => _begin?.Invoke();