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>(); } }
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); }
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); }
public void RpcShowHand(CommandShowHandMessage commandMessage, bool executeOnAllClients) { commandMessage.GetCommand().ExecuteOnClient(executeOnAllClients); }
public void CmdShowHand(CommandShowHandMessage commandMessage) { Instance.ExecuteServerCommand(commandMessage.GetCommand(), true); }