Example #1
0
    public CommandShowHand(CommandShowHandMessage message)
    {
        this.caller             = message.caller.GetComponent <Player>();
        this.hand               = message.hand.GetComponent <HandZone>();
        this.cardsAreFacingUp   = message.cardsAreFacingUp;
        this.exCardsAreFacingUp = message.exCardsAreFacingUp;
        this.exIsFacingUps      = message.exIsFacingUps;
        this.isFacingUps        = message.isFacingUps;


        cards = new CardView[message.cards.Length];
        for (int i = 0; i < cards.Length; i++)
        {
            cards[i] = message.cards[i].GetComponent <CardView>();
        }
    }
Example #2
0
    public CommandShowHandMessage GetCommandMessage()
    {
        var cardObjects = new GameObject[cards.Length];

        for (int i = 0; i < cards.Length; i++)
        {
            cardObjects[i] = cards[i].gameObject;
        }

        var message = new CommandShowHandMessage {
            caller             = caller.gameObject,
            hand               = hand.gameObject,
            cards              = cardObjects,
            isFacingUps        = isFacingUps,
            exIsFacingUps      = exIsFacingUps,
            cardsAreFacingUp   = cardsAreFacingUp,
            exCardsAreFacingUp = exCardsAreFacingUp
        };

        return(message);
    }
Example #3
0
    public override void UnExecuteServerCommand(bool executeOnAllClients)
    {
        base.UnExecuteServerCommand(executeOnAllClients);

        var cardObjects = new GameObject[cards.Length];

        for (int i = 0; i < cards.Length; i++)
        {
            cardObjects[i] = cards[i].gameObject;
        }

        var message = new CommandShowHandMessage
        {
            caller      = caller.gameObject,
            hand        = hand.gameObject,
            cards       = cardObjects,
            isFacingUps = exIsFacingUps,
            //exIsFacingUps = exIsFacingUps,
            cardsAreFacingUp = exCardsAreFacingUp,
            //exCardsAreFacingUp = exCardsAreFacingUp
        };

        CommandProcessor.Instance.RpcShowHand(message, executeOnAllClients);
    }
Example #4
0
 public void RpcShowHand(CommandShowHandMessage commandMessage, bool executeOnAllClients)
 {
     commandMessage.GetCommand().ExecuteOnClient(executeOnAllClients);
 }
Example #5
0
 public void CmdShowHand(CommandShowHandMessage commandMessage)
 {
     Instance.ExecuteServerCommand(commandMessage.GetCommand(), true);
 }