Exemplo n.º 1
0
    private void OnReadyToFight(Beetle p1, Beetle p2)
    {
        Color p1Dom = p1.GetDominantColor();
        Color p2Dom = p2.GetDominantColor();

        Color outcome = DecideOutcome(p1Dom, p2Dom);

        bool p1wins = outcome == p1Dom;

        if (outcome == Color.None)
        {
            p1wins = true;
        }

        OnMatchOutcomeDecided?.Invoke(p1wins);
        return;
    }