Module:RoleSet

local util_args = require('Module:ArgsUtil') local util_cargo = require("Module:CargoUtil") local util_html = require("Module:HtmlUtil") local util_map = require('Module:MapUtil') local util_table = require("Module:TableUtil") local util_text = require("Module:TextUtil") local util_vars = require("Module:VarsUtil") local i18n = require("Module:I18nUtil") local lang = mw.getLanguage('en')

local RoleList = require('Module:RoleList')

local LCS = require('Module:LuaClassSystem').class

local h = {} local p = LCS function p:init(strs, opts) self.all = RoleList(strs, opts) local opts2 = mw.clone(opts) opts2.alreadyCast = true self.ingame = RoleList(h.filterIngameRoles(self.all, true), opts2) self.staff = RoleList(h.filterIngameRoles(self.all, false), opts2) self.hasIngame = self.ingame:exists self.hasStaff = self.staff:exists self.isIngameOnly = not self.staff:exists self.isStaffOnly = not self.ingame:exists end

function h.filterIngameRoles(objs, isIngame) local filteredRoles = {} for _, role in ipairs(objs) do		if isIngame == role:isIngame then filteredRoles[#filteredRoles+1] = role end end return filteredRoles end

function p:tostring return self.all:tostring end

function p:__ipairs return self.all.__ipairs end

return p