------------------------------------------------ -- 作者: gzg -- 日期: 2021-02-25 -- 文件: ServerGroupInfo.lua -- 模块: ServerGroupInfo -- 描述: 服务器分组的信息 ------------------------------------------------ local ServerGroupInfo = { Name = nil, --当前组的开始ID StartID = nil, --当前组的结束ID EndID = nil, --服务器列表 ServerList = nil, } function ServerGroupInfo:New(startid,endid,serlist,name) local _m = Utils.DeepCopy(self); _m.StartID = startid; _m.EndID = endid; _m.ServerList = serlist; _m.Name = name; Debug.Log("ServerGroupInfo:New:" .. tostring(name)); _m.ServerList:Sort(function (x,y) return x.ShowOrder > y.ShowOrder; end) ; return _m; end function ServerGroupInfo:Create(alllist,startid,endid) local _list = nil; for i = alllist:Count() , 1, -1 do if (alllist[i].ShowOrder >= startid) and (alllist[i].ShowOrder <= endid) then if _list == nil then _list = List:New(); end _list:Add(alllist[i]); alllist:RemoveAt(i); end end if _list then --从大小的排序--运营需求 return ServerGroupInfo:New(startid,endid,_list,DataConfig.DataMessageString.Get("Area",startid,endid)); end return nil; end function ServerGroupInfo:GetName() return self.Name; end return ServerGroupInfo;