Module:Class tags

local api = require('Module:API') local utils = require('Module:Utils')

local p = {}

p.tag_data = { Deprecated = { category = "Deprecated classes"; description = "This class will be phased out and should be avoided while it is still available."; };   NotBrowsable = { description = "This class is not visible in documentation for end-users."; };   -- As of February 19, 2017, there are no backend classes. backend = { description = "This class can only be used in game servers and solo games."; };   NotCreatable = { category = "Unconstructable classes"; description = "This class cannot be instantiated."; };   NotReplicated = { category = "Unreplicated classes"; description = "This class is not replicated."; };   Service = { category = "Services"; description = "This class is a service."; }; }

p.extra_tags = { NotBrowsable = { 'Instance', 'DataModelMesh', 'BevelMesh', 'DebugSettings', 'FaceInstance', 'GameSettings', 'GuiBase2d', 'GuiObject', 'GuiButton', 'LayerCollector', 'LuaSourceContainer', 'NetworkMarker', 'NetworkPeer', 'NetworkSettings', 'PVInstance', 'BasePart', 'RootInstance', 'RenderSettings', 'RobloxReplicatedStorage', 'ServiceProvider', 'GlobalSettings', 'TouchTransmitter', 'TweenBase', 'UIGridStyleLayout', 'ValueBase'; },	Deprecated = { 'Hat', 'Skin', 'CustomEvent', 'CustomEventReceiver', 'BevelMesh', 'DoubleConstrainedValue', 'Hole', 'MotorFeature', 'FunctionalTest', 'GuiMain', 'FloorWire', 'SelectionPartLasso', 'SelectionPointLasso', 'HopperBin', 'Flag', 'Hopper', 'IntConstrainedValue', 'Message', 'Hint', 'FlagStand', 'SkateboardPlatform', 'Status', 'CylinderMesh', },	NotCreatable = { 'InstancePacketCache', 'JointsService', 'Lighting', 'LocalWorkspace', 'LocalizationService', 'LogService', 'CoreScript', 'MarketplaceService', 'NetworkClient', 'NetworkServer', 'NetworkReplicator', 'ClientReplicator', 'ServerReplicator', 'NotificationService', 'Terrain', 'Status', 'PathfindingService', 'PhysicsPacketCache', 'PlayerJoinData', 'PlayerScripts', 'PluginGui', 'PluginGuiService', 'PointsService', 'ReplicatedFirst', 'ReplicatedStorage', 'RobloxReplicatedStorage', 'RuntimeScriptService', 'ScriptContext', 'ScriptDebugger', 'ServerScriptService', 'ServerStorage', 'SoundService', 'StarterPlayer', 'Teams', 'TextFilterResult', 'ThirdPartyUserService', 'TimerService', 'TouchTransmitter', 'Translator', 'UserInputService', 'VirtualUser', 'Visit', }, }

-- Returns whether a class has a tag function p.has_tag(class_name, tag) local extra_class_list = p.extra_class_tags[tag] if extra_class_list then if utils.in_array(extra_class_list, class_name) then return true end end local class_data = api.get_class_data(class_name) if class_data then local class_tags = class_data.Tags if class_tags then for i = 1, #class_tags do               if class_tags[i] == tag then return true end end end end return false end

-- Return an array of a class' tags function p.get_tags(class_name) local tags = {} local class_data = api.get_class_data(class_name) if class_data then local class_tags = class_data.Tags if class_tags then for i = 1, #class_tags do               tags[class_tags[i]] = true end end end for tag, array in pairs(p.extra_class_tags) do       if utils.in_array(array, class_name) then tags[tag] = true end end return utils.set_to_array(tags) end

return p