local s=(require(((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\083\099\114\105\112\116\115")):WaitForChild("\067\111\110\115\111\108\101"))).sourced("\067\111\110\116\114\111\108 \083\099\104\101\109\101")s.log("\076\111\097\100\105\110\103 \100\101\112\101\110\100\101\110\099\105\101\115\046\046\046")local U=require(script:WaitForChild("\067\111\110\116\114\111\108"))s.log("\073\110\105\116\105\097\108\105\122\105\110\103 \118\097\114\105\097\098\108\101\115\046\046\046")local g={}s.log("\067\111\110\115\116\114\117\099\116\105\110\103 \111\098\106\101\099\116\115\046\046\046")g.__index=g function g.new()local s=setmetatable({},g)s.ControlSet={}s.Name="\067\111\110\116\114\111\108\083\099\104\101\109\101"return s end function g.Add(g,s)if type(s)=="\115\116\114\105\110\103"then s=U.new(s)end g.ControlSet[s.Name]=s return s end function g.Remove(U,s)U.ControlSet[s]=nil end s.log("\068\111\110\101\046")return g
--- Set of Controls that are used together.
-- Contains control mappings that are bound and unbound together. These are
-- equivalent to control contexts e.g. menus, game modes, and different
-- character, vehicle, etc. control modes.
--
-- @author LastTalon
-- @version 0.1.0, 2020-04-14
-- @since 0.1
--
-- @module ControlScheme
-- @field ControlSet the set of Controls in this ControlScheme
--
-- @see Control

local Console = require(game:GetService("ReplicatedStorage"):WaitForChild("Scripts"):WaitForChild("Console")).sourced("Control Scheme")

-- Dependencies --
Console.log("Loading dependencies...")

local Control = require(script:WaitForChild("Control"))

-- Variables --
Console.log("Initializing variables...")

local ControlScheme = {}

-- Local Objects --
Console.log("Constructing objects...")

ControlScheme.__index = ControlScheme

--- The default constructor.
-- Creates a new ControlScheme with an empty set of Controls.
--
-- @return the new ControlScheme
function ControlScheme.new()
	local self = setmetatable({}, ControlScheme)
	self.ControlSet = {}
	self.Name = "ControlScheme"
	return self
end

--- Adds a new Control.
-- Adds the new Control the ControlScheme. If a Control is not specified it
-- creates a new one. It then returns the Control added.
--
-- @param control the Control to add
-- @return the Control added
function ControlScheme:Add(control)
	if type(control) == "string" then
		control = Control.new(control)
	end
	self.ControlSet[control.Name] = control
	return control
end

--- Removes a Control.
-- Removes the Control at the specified id.
--
-- @param id the id of the Control to remove
function ControlScheme:Remove(id)
	self.ControlSet[id] = nil
end

-- End --
Console.log("Done.")

return ControlScheme
