Beispiel #1
0
 public int GoodsDealRecordSort(GoodsDealRecord x, GoodsDealRecord y)
 {
     if (x.Time > y.Time)
     {
         return(-1);
     }
     return(1);
 }
 //存储物品 变化记录 只会存储钻石的
 public static async void SaveGoodsDealRecord(this UserComponent self, User user, List <GetGoodsOne> goodsOnes, int changeType)
 {
     for (int i = 0; i < goodsOnes.Count; i++)
     {
         if (goodsOnes[i].GoodsId != GoodsId.Jewel)
         {
             continue;
         }
         GoodsDealRecord goodsDealRecord = ComponentFactory.Create <GoodsDealRecord>();
         goodsDealRecord.UserId          = user.UserId;
         goodsDealRecord.Amount          = goodsOnes[i].GetAmount;
         goodsDealRecord.Type            = changeType;
         goodsDealRecord.Time            = TimeTool.GetCurrenTimeStamp();
         goodsDealRecord.FinishNowAmount = (int)user.Jewel;
         await self.dbProxyComponent.Save(goodsDealRecord);
     }
 }