Files
Main/Assets/GameAssets/Resources/Lua/Logic/Shop/HouseShopData.lua
2025-01-25 04:38:09 +08:00

85 lines
2.4 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

------------------------------------------------
--作者:何健
--日期2019-07-08
--文件HouseShopData.lua
--模块HouseShopData
--描述:商店数据模型
------------------------------------------------
local HouseShopData = {
--商品id
SellId = 0,
--商品个数
Count = 0,
--商品分类ID列表
ItemTypeList = List:New(),
--对应物品表ID
ItemId = 0,
--排序序号。所有位置根据此来定
Index = 0,
--职业
Occ = -1,
--货币类型 从物品配置表查找
CoinType = 0,
--现在价格,可能是原始价格,也可以是打折后的价格
Price = 0,
--原始价格
OrigionPrice = 0,
--商品状态,比如是否热销,是否折扣。等
Hot = 0,
--打折数0为不打折,>0为具体打折数
Discount = 0,
--购买时是否立即绑定
BuyBind = false,
--消失时间
TimeOut = 0,
--过期时间
LostTime = "",
--购买限制数量 0为无限制
BuyLimit = 0,
--已经购买的次数
AlreadyBuyNum = 0,
--购买等级限制
BuyLv = 0,
--帮会等级限制
GuildLv = 0,
--购买VIP等级限制
VipLv = 0,
--军衔等级限制
MilitaryRanklevel = 0,
--限购类型 0.不限购1.日限够2.周限购3.月限购4.年限购5.终身限购
LimitType = 0,
--是否有VIP等级优惠
IsDisCount = 0,
--购买次数折扣
CountdisCount = nil,
--根据购买次数浮动的价格增量
AddPrice = 0,
--物品
ItemInfo = nil
}
--新建一个对象以协议MSG_Shop.shopItemInfo为数据源
function HouseShopData:New(itemID, count)
local itemInfo = DataConfig.DataSocialHouseMarket[itemID]
if itemInfo then
local _m = Utils.DeepCopy(self)
_m.SellId = itemInfo.ID;
_m.ItemId = itemInfo.FurnitureID;
_m.Index = itemInfo.Sort;
_m.CoinType = itemInfo.CurrencyID;
_m.Price = itemInfo.Price;
_m.OrigionPrice = itemInfo.Price;
_m.Hot = itemInfo.Promotion;
_m.BuyLimit = itemInfo.BuyNum;
_m.BuyLv = itemInfo.Level;
_m.LimitType = itemInfo.LimitType;
_m.ShopID = itemInfo.ShopID;
_m.ShopType = itemInfo.ShopType;
_m.RemainBuyNum = count
if _m.RemainBuyNum <= 0 then
_m.Index = _m.Index + 999999
end
return _m
end
return nil
end
return HouseShopData