Exemplo n.º 1
0
        public static void AgreeProp(Proposal prop)
        {
            BookManager      BM = BookManager.Instance;
            HandCardsManager HM = HandCardsManager.Instance;

            if (prop.InBook != null)
            {
                BM.RemoveBook(prop.InBook);
            }
            if (prop.InHand != null)
            {
                HM.Add_Book(prop.InHand);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据策略换牌
        /// </summary>
        /// <param name="hm"></param>
        public void RollCards(HandCardsManager hm)
        {
            Debug.Log("换牌1");
            int value = hm.drop.value;

            int[] ploy = new int[] { -1, -1, -1, -1, -1 };

            RefreshLib();

            //选择策略
            switch (value)
            {
            case 0:
                ploy = HandCardsManager.Ploy.PJ;
                break;

            case 1:
                ploy = HandCardsManager.Ploy.JH;
                break;

            case 2:
                ploy = HandCardsManager.Ploy.WH;
                break;
            }
            Debug.Log("换牌");
            //为卡牌对象获取卡牌信息
            for (int i = 0; i < hm.Cards.Count; i++)
            {
                GameObject h = hm.Cards[i];
                CardData   nCard;
                if (ploy[i] != -1)
                {
                    nCard = RollCard(ploy[i]);
                }
                else
                {
                    Debug.Log("策略加载失败");
                    continue;
                }
                if (nCard == null)
                {
                    Debug.Log("未找到合适的卡牌 :" + ploy[i] + "\n");
                    continue;
                }
                nCard.Get_IsInLib = false;
                RefreshCard(h, nCard);
            }
        }
Exemplo n.º 3
0
 private void Update()
 {
     if (GM == null)
     {
         GM = GameManager.Instance;
     }
     if (HM == null)
     {
         HM = HandCardsManager.Instance;
     }
     if (BM == null)
     {
         BM = BookManager.Instance;
     }
     //if (card != null)
     //{
     //    obj.transform.parent.gameObject.GetComponent<Image>().sprite = card.icon;
     //}
 }
Exemplo n.º 4
0
 private void Start()
 {
     Instance = this;
     GM       = GameManager.Instance;
 }