예제 #1
0
    public void LoadNetZone(RuntimeZone _localZone, NetZone _netZone, PlayerData _ownerPlayer)
    {
        //remove any illegal cards
        for (int i = 0; i < _localZone.cards.Count; i++)
        {
            RuntimeCard _card = _localZone.cards[i];
            if (Array.Exists(_netZone.cards, x => x.unique_cardId == _card.guid) == false)
            {
                //remove the card
                StartCoroutine(GameScene.Active.ShowPlayerMessage("Developer Warning:: The Server Reverted A Move"));
                _localZone.RemoveCard(_card.guid);
            }
        }

        //add any new cards
        for (int i = 0; i < _netZone.cards.Length; i++)
        {
            NetCard     _card      = _netZone.cards[i];
            RuntimeCard _localCard = _localZone.cards.Find(x => x.guid == _card.unique_cardId);
            if (_localCard == null)
            {
                //add the card
                _localZone.AddCard(NetworkUtilities.GetRuntimeCard(_card, _ownerPlayer));
            }
        }
    }
    public static void MoveCard(RuntimeZone _fromZone, RuntimeZone _toZone, int _unique_CardId)
    {
        RuntimeCard _card = _fromZone.cards.Find(x => x.guid == _unique_CardId);

        _fromZone.RemoveCard(_unique_CardId);
        _toZone.AddCard(_card);
    }