|
Post by TAGAR on Apr 27, 2019 23:58:20 GMT
Hello thanks for all this awesome stuff. void OnPerformPlayCard(object sender, object args)
{
var action = args as PlayCardAction;
if (action.card.zone == Zones.Hand)
ChangeZone(action.card, Zones.Archive);
Debug.Log(action.player.mode.ToString()); }
wouldnt that action be the player who played the card or is that assigned later?
|
|
|
Post by Admin on May 6, 2019 20:56:14 GMT
I'm not sure I understand what you are asking. Generally speaking, a play card action would be triggered as a result of the current player manually playing a card. A custom event could potentially cause a card to be played automatically if you wanted.
If you are asking when to assign the various fields of the base class "GameAction" (such as the "player" field) then you could do it here if you wanted. The question would be what does the "player" field mean in the context of this action. If you want to know the owner of the card, you can get it via the card's "ownerIndex". If you want to know what player is "current" you can get it from the Match. So neither of those are necessary to assign to this action. If you want to know what player is most responsible for the action being triggered, then you will need something more advanced, but whatever you determined could be saved here.
|
|
|
Post by TAGAR on May 9, 2019 14:45:58 GMT
thankyou for the reply - yup i used the ownerindex in the end - i just figured in the gameaction there is a player variable listed so i thought that it was automatically assigned upon it being created or the card being used or something -i figured it must be used for something else instead then ... used for any purpose that could be assigned via any action inheriting gameaction...what it sounds like from your reply that is the case.
|
|