Ejemplo n.º 1
0
    public override void ChoosePlayerAction(List <Card> cards, Game game, Player choosingPlayer, out ChoiceHandler.PlayerActionParams outPlayerAction)
    {
        ChoiceHandlerDelegator.Instance.TriggerChoice(this, choosingPlayer, new CardAndUsageInputHandler());
        waitForInput.WaitOne();

        outPlayerAction = new ChoiceHandler.PlayerActionParams();

        if (passedParams == null)
        {
            outPlayerAction.usage = ChoiceHandler.PlayerActionParams.UsageType.Cancelled;
        }
        else
        {
            outPlayerAction.usage = (ChoiceHandler.PlayerActionParams.UsageType)passedParams[0];

            if (outPlayerAction.usage != ChoiceHandler.PlayerActionParams.UsageType.Mulligan)
            {
                outPlayerAction.card = (Card)passedParams[1];

                for (int i = 2; i < passedParams.Length; ++i)
                {
                    outPlayerAction.misc.Add(passedParams[i]);
                }
            }
        }

        passedParams = null;
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (doNotifyStateStart)
        {
            if (NotifyStateStart != null)
            {
                NotifyStateStart();
            }
            doNotifyStateStart = false;
        }

        if (doNotifyStartOfTurn)
        {
            if (NotifyStartOfTurn != null)
            {
                NotifyStartOfTurn();
            }
            doNotifyStartOfTurn = false;
        }

        if (doNotifyPlayerActionPerformed)
        {
            if (NotifyPlayerActionPerformed != null)
            {
                NotifyPlayerActionPerformed(usageParamsArg);
            }
            doNotifyPlayerActionPerformed = false;
            usageParamsArg = null;
        }

        if (doNotifyGameEnd)
        {
            if (NotifyGameEnd != null)
            {
                NotifyGameEnd(gameResultArg.winningPlayer, gameResultArg.notEnoughGuiltVictory, gameResultArg.finalScore);
            }
            doNotifyGameEnd = false;
            gameResultArg   = null;
        }
    }
Ejemplo n.º 3
0
 private void triggerPlayerActionPerformed(ChoiceHandler.PlayerActionParams usageParams)
 {
     doNotifyPlayerActionPerformed = true;
     usageParamsArg = usageParams;
 }
Ejemplo n.º 4
0
 private void playerActionPerformed(ChoiceHandler.PlayerActionParams usageParams)
 {
     initHandDisplay();
 }