예제 #1
0
 /// <summary>
 /// 获得新的符文,添加至背包中。
 /// </summary>
 /// <param name="inscriptionid"></param>
 public static void AddInscritonToBag(int inscriptionid)
 {
     //Todo:发送更新信息给服务器
     if (inscriptionList.ContainsKey(inscriptionid))
     {
         inscriptionList[inscriptionid].inscriptionNumber += 1;
     }
     else
     {
         InscriptionMessage inscriptionMessage = new InscriptionMessage();
         inscriptionMessage.inscriptionNumber = 1;
         inscriptionMessage.inscriptionId     = inscriptionid;
         inscriptionList.Add(inscriptionid, inscriptionMessage);
     }
 }
예제 #2
0
        /// <summary>
        /// 从背包中移除符文
        /// </summary>
        /// <param name="inscriptionid"></param>
        public static void RemoveInscriptionFromBag(int inscriptionid)
        {
            //Todo:发送更新的数据给服务器
            if (!inscriptionList.ContainsKey(inscriptionid))
            {
                return;
            }
            InscriptionMessage inscriptionMessage = inscriptionList[inscriptionid];

            if (inscriptionMessage.inscriptionUseNumber < inscriptionMessage.inscriptionNumber)
            {
                inscriptionMessage.inscriptionNumber -= 1;
                if (inscriptionMessage.inscriptionNumber == 0)
                {
                    inscriptionList.Remove(inscriptionid);
                }
            }
        }