代码优化
This commit is contained in:
parent
804ee3251d
commit
87e8b9a261
@ -284,65 +284,6 @@ func (c *ChargeMod) FireFreeShop() ([]*item.Item, error) {
|
|||||||
return chargeCfg.GetFreeShopReward(c.FreeShop), nil
|
return chargeCfg.GetFreeShopReward(c.FreeShop), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回数据
|
|
||||||
// func (c *ChargeMod) BackData() *msg.ResCharge {
|
|
||||||
// SpecialShop := make(map[int32]*msg.ResSpecialShop)
|
|
||||||
// ChessShop := make(map[int32]*msg.ResChessShop)
|
|
||||||
// for k, v := range c.SpecialShop {
|
|
||||||
// SpecialShop[int32(k)] = &msg.ResSpecialShop{
|
|
||||||
// Grade: int32(v.Grade),
|
|
||||||
// Count: int32(v.Count),
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for k, v := range c.ChessShop {
|
|
||||||
// ChessShop[int32(k)] = &msg.ResChessShop{
|
|
||||||
// Diamond: int32(v.Diamond),
|
|
||||||
// Count: int32(v.Count),
|
|
||||||
// ChessId: int32(v.Id),
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// resWish := &msg.WishList{}
|
|
||||||
// if c.WishList != nil {
|
|
||||||
// resWish = &msg.WishList{
|
|
||||||
// Id: int32(c.WishList.ItemId),
|
|
||||||
// Count: int32(c.WishList.Count),
|
|
||||||
// Uid: c.WishList.SendList,
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// WeeklyDiscount := make(map[int32]*msg.WeeklyDiscountInfo)
|
|
||||||
// WeeklyDiscountInfo := chargeCfg.GetWeeklyInfoAll()
|
|
||||||
// if c.IsWeeklyDiscountDay() {
|
|
||||||
// for k, v := range WeeklyDiscountInfo {
|
|
||||||
// LimitNum := c.WeeklyDiscount[k]
|
|
||||||
// WeeklyDiscount[int32(k)] = &msg.WeeklyDiscountInfo{
|
|
||||||
// Discount: int32(v.Discount),
|
|
||||||
// Count: int32(v.WeeklyLimit - LimitNum),
|
|
||||||
// Id: int32(k),
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return &msg.ResCharge{
|
|
||||||
// Charge: float32(c.Charge),
|
|
||||||
// Total: int32(c.Total),
|
|
||||||
// First: GoUtil.MapIntToSlice(c.EnergyShop),
|
|
||||||
// SpecialShop: SpecialShop,
|
|
||||||
// FreeShop: int32(c.FreeShop),
|
|
||||||
// ChessShop: ChessShop,
|
|
||||||
// Gift: GoUtil.MapIntToInt32(c.Gift),
|
|
||||||
// Ad: c.Ad,
|
|
||||||
// SpecialCharge: float32(c.SpecialCharge),
|
|
||||||
// SpecialChargeWeek: int32(GoUtil.FullWeeksSince(c.LastSpecialCharge)),
|
|
||||||
// TodayCharge: float32(c.TodayCharge),
|
|
||||||
// MonthCharge: float32(c.MonthCharge),
|
|
||||||
// Wish: resWish,
|
|
||||||
// AdEndTime: c.AdEndTime,
|
|
||||||
// WeeklyDiscount: WeeklyDiscount,
|
|
||||||
// PetWorkRemainTime: c.PetWorkTime,
|
|
||||||
// WeeklyEndTime: c.WeeklyEndTime,
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
func (c *ChargeMod) InitChessShop(Emit []int) {
|
func (c *ChargeMod) InitChessShop(Emit []int) {
|
||||||
if len(Emit) == 0 {
|
if len(Emit) == 0 {
|
||||||
return
|
return
|
||||||
@ -371,21 +312,7 @@ func (c *ChargeMod) InitChessShop(Emit []int) {
|
|||||||
RandList = append(RandList, &Rand{ChessId: c, Diamond: int(Diamond)})
|
RandList = append(RandList, &Rand{ChessId: c, Diamond: int(Diamond)})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//ColorList = append(ColorList, ProduceList...)
|
|
||||||
}
|
}
|
||||||
// for _, v := range ColorList {
|
|
||||||
// ColorType := mergeDataCfg.GetColorType(v)
|
|
||||||
// r := make([]*Rand, 0)
|
|
||||||
// switch ColorType {
|
|
||||||
// case mergeDataCfg.CHESS_PRODUCT_MAIN_TYPE:
|
|
||||||
// r = getChessMainRand(v)
|
|
||||||
// case mergeDataCfg.CHESS_PRODUCT_SECONDARY_TYPE:
|
|
||||||
// r = getChessSecondaryRand(v)
|
|
||||||
// case mergeDataCfg.CHESS_PRODUCT_SUB_TYPE:
|
|
||||||
// r = getChessSubRand(v)
|
|
||||||
// }
|
|
||||||
// RandList = append(RandList, r...)
|
|
||||||
// }
|
|
||||||
randList := make([]interface{}, len(RandList))
|
randList := make([]interface{}, len(RandList))
|
||||||
for k, v := range RandList {
|
for k, v := range RandList {
|
||||||
randList[k] = v
|
randList[k] = v
|
||||||
@ -450,10 +377,6 @@ func (c *ChargeMod) BuyChess(Chess int, IsWeeklyDiscount bool) ([]*item.Item, []
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *ChargeMod) TriggerChargeUnlock(Lv int, Emit []int) {
|
func (c *ChargeMod) TriggerChargeUnlock(Lv int, Emit []int) {
|
||||||
//UnlockLv := chargeCfg.GetUnlockShopLv()
|
|
||||||
// if Lv != UnlockLv {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
c.InitChessShop(Emit)
|
c.InitChessShop(Emit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user