73 lines
1.0 KiB
Lua
73 lines
1.0 KiB
Lua
--放子数据对象
|
||
--author:--
|
||
|
||
--[[
|
||
--数据字段参考
|
||
|
||
local FZData = {
|
||
-- 放子类型
|
||
type = TX_FZType.Chi,
|
||
-- 吃的牌
|
||
card = 0,
|
||
-- 激活牌
|
||
active_card = 0,
|
||
--
|
||
from_seat = 0,
|
||
|
||
}
|
||
|
||
|
||
local FZTip = {
|
||
--提示ID
|
||
id = 0,
|
||
--权重
|
||
weight = 0,
|
||
--类型
|
||
type = 0,
|
||
--牌
|
||
card = 0,
|
||
--手牌吃牌组
|
||
op_card = nil
|
||
}
|
||
|
||
]] --
|
||
|
||
FZType =
|
||
{
|
||
Chi = 1,
|
||
Peng = 2,
|
||
Gang = 3,
|
||
Gang_An = 4,
|
||
Gang_Peng = 5,
|
||
HU = 6,
|
||
}
|
||
|
||
local FZTipList = {
|
||
tip_map_id = nil,
|
||
tip_map_type = nil
|
||
}
|
||
|
||
local M = FZTipList
|
||
|
||
function M.new()
|
||
local self = {}
|
||
setmetatable(self, { __index = FZTipList })
|
||
self.tip_map_id = {}
|
||
self.tip_map_type = {}
|
||
self.tip_num = 0
|
||
return self
|
||
end
|
||
|
||
function M:AddTip(tip)
|
||
self.tip_map_id[tip.id] = tip
|
||
local tiplist = self.tip_map_type[tip.weight]
|
||
if not tiplist then
|
||
tiplist = {}
|
||
self.tip_map_type[tip.weight] = tiplist
|
||
end
|
||
tiplist[#tiplist + 1] = tip
|
||
self.tip_num = self.tip_num + 1
|
||
end
|
||
|
||
return M
|