/// <summary> /// 一般由协议调用,为对手设置卡组 /// </summary> /// <param name="cardGroupInfo"></param> public void SetCardGroup(string cardGroupInfo) { duelCardGroup = new DuelCardGroup(); string[] cardNos = cardGroupInfo.Split(':'); foreach (var item in cardNos) { duelCardGroup.AddCard(int.Parse(item.Substring(0, item.IndexOf('-'))), int.Parse(item.Substring(item.IndexOf('-') + 1))); } opponentPlayer.SetCardGroupNotify(duelCardGroup); iamReady = true; duelScene.CheckPlayInit(); }
public override void SetCardGroupNotify(DuelCardGroup duelCardGroup) { CCardGroup cCardGroup = new CCardGroup(); StringBuilder stringBuilder = new StringBuilder(); List <CardBase> cards = duelCardGroup.GetCards(); for (int i = 0; i < cards.Count - 1; i++) { stringBuilder.Append(cards[i].GetCardNo() + "-" + cards[i].GetID() + ":"); } stringBuilder.Append(cards[cards.Count - 1].GetCardNo() + "-" + cards[cards.Count - 1].GetID()); cCardGroup.AddContent("cardGroupList", stringBuilder.ToString()); ClientManager.GetSingleInstance().SendProtocol(cCardGroup); }
/// <summary> /// 设置卡组 /// </summary> /// <param name="selectCardGroup"></param> public virtual void SetCardGroup() { if (duelCardGroup != null) { return; } duelCardGroup = new DuelCardGroup(); UserCardGroup selectCardGroup = GameManager.GetSingleInstance().GetUserData().GetCardGroupByName(cardGroupName); foreach (var item in selectCardGroup.mainCardList) { for (int i = 0; i < item.number; i++) { duelCardGroup.AddCard(item.cardNo); } } ShuffleCardGroup(); opponentPlayer.SetCardGroupNotify(duelCardGroup); iamReady = true; duelScene.CheckPlayInit(); }
/// <summary> /// 设置卡组时的提醒 /// </summary> /// <param name="duelCardGroup"></param> public virtual void SetCardGroupNotify(DuelCardGroup duelCardGroup) { }