Esempio n. 1
0
        private void PayBills()
        {
            var tempList = _model.CurrentMailList !.HandList;

            tempList.ForEach(mail =>
            {
                _gameContainer.SingleInfo !.ReduceFromPlayer(Math.Abs(mail.AmountReceived));
                _gameContainer.SaveRoot !.OutCards.Add(mail);
                _gameContainer.SingleInfo !.Hand.RemoveSpecificItem(mail);
            });
        }
Esempio n. 2
0
        private async Task ReshuffleDealsAsync()
        {
            var thisList = _gameContainer.SaveRoot !.OutCards.GetMailOrDealList <DealCard>(EnumCardCategory.Deal);

            thisList.ShuffleList();
            if (_gameContainer.BasicData !.MultiPlayer == true)
            {
                await _gameContainer.Network !.SendAllAsync("reshuffledeallist", thisList.GetDeckListFromObjectList());
            }
            await ReshuffleDealsAsync(thisList);
        }
Esempio n. 3
0
        private async Task ReshuffleMailAsync()
        {
            var list = _gameContainer.SaveRoot !.OutCards.GetMailOrDealList <MailCard>(EnumCardCategory.Mail);

            list.ShuffleList();
            if (_gameContainer.BasicData !.MultiPlayer == true)
            {
                await _gameContainer.Network !.SendAllAsync("reshufflemaillist", list.GetDeckListFromObjectList());
            }
            await ReshuffleMailAsync(list);
            await ProcessMailAsync();
        }
Esempio n. 4
0
        /// <summary>
        ///     重连
        /// </summary>
        /// <param name="data"></param>
        /// <param name="lastIn"></param>
        /// <param name="isCurrent"></param>
        public virtual void OnReJoin(ISFSObject data)
        {
            #region Data

            ISFSArray Groups;
            int[]     OutCards;
            int[]     HandCards;
            int       HandNum;
            bool      hasTing;
            GameTools.TryGetValueWitheKey(data, out Groups, RequestKey.KeyGroups);
            GameTools.TryGetValueWitheKey(data, out OutCards, RequestKey.KeyOutCards);
            GameTools.TryGetValueWitheKey(data, out HandCards, RequestKey.KeyHandCards);
            GameTools.TryGetValueWitheKey(data, out HandNum, RequestKey.KeyHandCardsNum);
            GameTools.TryGetValueWitheKey(data, out hasTing, RequestKey.KeyHasTing);
            HasTing       = hasTing;
            GroupItems    = new List <MahjongGroupData>();
            ThrowOutCards = new List <int>();
            GroupItems.AddRange(GameTools.GetGroupData(Groups));
            ThrowOutCards.AddRange(OutCards.ToList());
            if (HandCards.Length.Equals(0))
            {
                HandCards = new int[HandNum];
            }
            HandCardList = HandCards.ToList();

            #endregion

            #region UI

            MahjongEnv.AddOutCards(ThrowOutCards);
            for (int i = 0, lenth = GroupItems.Count; i < lenth; i++)
            {
                MahjongEnv.AddGroup(GroupItems[i], null, IsOther);
            }
            AddHandCards(HandCardList);
            if (hasTing)
            {
                ShowTingWithEffect(false);
            }

            #endregion
        }
 private void RemovePlayerDeal(DealCard thisCard)
 {
     _gameContainer.SingleInfo !.Hand.RemoveSpecificItem(thisCard);
     _gameContainer.SaveRoot !.OutCards.Add(thisCard);
 }
 public void AddOutCard(CardInformation thisCard)
 {
     SaveRoot !.OutCards.Add(thisCard);
 }
 public void RemoveOutCards(IDeckDict <CardInformation> listToRemove)
 {
     SaveRoot !.OutCards.RemoveGivenList(listToRemove); //hopefully this simple.
 }