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("\066\105\110\097\114\121 \077\111\110\105\116\111\114")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.Parent)local g=require(script.Parent.Parent:WaitForChild("\073\110\112\117\116\084\121\112\101"))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 L=U.new()s.log("\067\111\110\115\116\114\117\099\116\105\110\103 \111\098\106\101\099\116\115\046\046\046")L.__index=L function L.new()local s=setmetatable({},L)return s end function L.transformValue(L,s,U)local P=s.Type if P==g.None or P==g.Keyboard or P==g.MouseButton or P==g.GamepadButton then return U,0 elseif P==g.MouseMovement or P==g.GamepadDirection then return U~=Vector3.new(0,0,0),0 end return false,0 end function L.addValue(g,s,U)return s or U end function L.scaleValue(U,s)return s end function L.defaultValue(s)return false end function L.processEntry(s) end function L.clean(s) end s.log("\068\111\110\101\046")return L.new()
--- A Monitor with a binary value.
-- Provides a value of either true if the Control is activated, or false, if
-- its not. Does not provide any scaling, any portion of the Control activates,
-- the BinaryMonitor will be activated.
--
-- @author LastTalon
-- @version 0.1.1, 2020-10-01
-- @since 0.1
--
-- @module BinaryMonitor

local Console = require(game:GetService("ReplicatedStorage"):WaitForChild("Scripts"):WaitForChild("Console")).sourced("Binary Monitor")

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

local Monitor = require(script.Parent)
local InputType = require(script.Parent.Parent:WaitForChild("InputType"))

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

local BinaryMonitor = Monitor.new()

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

BinaryMonitor.__index = BinaryMonitor

--- The default constructor.
--
-- @return the new BinaryMonitor
function BinaryMonitor.new()
	local self = setmetatable({}, BinaryMonitor)
	return self
end

--- Transforms the value to true or false depending on the InputType.
-- For most InputTypes no transformation is done. For vector InputTypes
-- MouseMovement and GamepadDirection a non-zero vector is transformed to true,
-- while a zero vector is transformed to false.
--
-- @param input the input that produced the value being transformed
-- @param value the value being transformed
-- @return the transformed value. Either true or false.
-- @return the scaling factor. Always 0, no scaling is done.
function BinaryMonitor:transformValue(input, value)
	local type = input.Type
	if type == InputType.None or type == InputType.Keyboard or type == InputType.MouseButton or type == InputType.GamepadButton then
		return value, 0
	elseif type == InputType.MouseMovement or type == InputType.GamepadDirection then
		return value ~= Vector3.new(0, 0, 0), 0
	end
	return false, 0
end

--- Adds two binary values together.
-- Combines the values by treating 'or' as the adding operation. Either operand
-- being true will result in true, false otherwise.
--
-- @param lhs the left hand side operand of the add operation
-- @param rhs the right hand side operand of the add operation
-- @return the added value. True if lhs or rhs is true, false otherwise.
function BinaryMonitor:addValue(lhs, rhs)
	return lhs or rhs
end

--- Does no scaling.
-- The value is always returned as is.
--
-- @param value the value to be scaled
-- @return the original value with no scaling applied
function BinaryMonitor:scaleValue(value)
	return value
end

--- Gets the default value of false for a BinaryMonitor.
--
-- @return the default value. Always false.
function BinaryMonitor:defaultValue()
	return false
end

--- Performs no processing.
function BinaryMonitor:processEntry()
end

--- Does no cleaning.
-- BinaryMonitor keeps no special state, so no special cleaning is needed.
function BinaryMonitor:clean()
end

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

return BinaryMonitor.new()
