-- Compiled with roblox-ts v1.3.3
local TS = _G[script]
local DoublyLinkedList = TS.import(script, script.Parent, "DoublyLinkedList").DoublyLinkedList
local reverseArray = TS.import(script, script.Parent.Parent, "util", "reverseArray").reverseArray
warn("This Stack class should not be used anymore! Switch to @rbxts/stacks-and-queues")
local Stack
do
	Stack = setmetatable({}, {
		__tostring = function()
			return "Stack"
		end,
	})
	Stack.__index = Stack
	function Stack.new(...)
		local self = setmetatable({}, Stack)
		return self:constructor(...) or self
	end
	function Stack:constructor(values)
		self.linkedList = DoublyLinkedList.new(if values ~= nil then reverseArray(values) else nil)
	end
	function Stack:getNextValue()
		return self.linkedList:getHeadValue()
	end
	function Stack:isEmpty()
		return self.linkedList:isEmpty()
	end
	function Stack:popNextValue()
		return self.linkedList:popHeadValue()
	end
	function Stack:push(value)
		self.linkedList:pushToHead(value)
	end
	function Stack:pushArray(values)
		local tempLinkedList = DoublyLinkedList.new(reverseArray(values))
		self.linkedList:pushListToHead(tempLinkedList)
	end
	function Stack:size()
		return self.linkedList:size()
	end
end
return {
	Stack = Stack,
}
