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; }
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; } }
private void triggerPlayerActionPerformed(ChoiceHandler.PlayerActionParams usageParams) { doNotifyPlayerActionPerformed = true; usageParamsArg = usageParams; }
private void playerActionPerformed(ChoiceHandler.PlayerActionParams usageParams) { initHandDisplay(); }